From 77087f1c377610023aeace644a4a22325a0c30d0 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Knuti=5Fin=5FP=C3=A4se?= <122045840+PaeserBastelstube@users.noreply.github.com> Date: Wed, 11 Jan 2023 14:42:30 +0100 Subject: [PATCH] RPI simpify and complete debug message Debug message in function "poll_inverter" is not maintainable. It is very easy to print a dict with all important data instead. --- tools/rpi/hoymiles/__main__.py | 13 +------------ 1 file changed, 1 insertion(+), 12 deletions(-) diff --git a/tools/rpi/hoymiles/__main__.py b/tools/rpi/hoymiles/__main__.py index e3000806..842cf7fa 100644 --- a/tools/rpi/hoymiles/__main__.py +++ b/tools/rpi/hoymiles/__main__.py @@ -168,18 +168,7 @@ def poll_inverter(inverter, dtu_ser, do_init, retries): data = result.__dict__() if hoymiles.HOYMILES_DEBUG_LOGGING: - dbg = f'{c_datetime} Decoded: temp={data["temperature"]}, total={data["energy_total"]/1000:.3f}' - if data['powerfactor'] is not None: - dbg += f', pf={data["powerfactor"]}' - phase_id = 0 - for phase in data['phases']: - dbg += f' phase{phase_id}=voltage:{phase["voltage"]}, current:{phase["current"]}, power:{phase["power"]}, frequency:{data["frequency"]}' - phase_id = phase_id + 1 - string_id = 0 - for string in data['strings']: - dbg += f' string{string_id}=voltage:{string["voltage"]}, current:{string["current"]}, power:{string["power"]}, total:{string["energy_total"]/1000}, daily:{string["energy_daily"]}' - string_id = string_id + 1 - logging.debug(dbg) + logging.debug(f'{c_datetime} Decoded: {result.__dict__()}') if 'event_count' in data: if event_message_index[inv_str] < data['event_count']: