Browse Source

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.
pull/578/head
Knuti_in_Päse 2 years ago
committed by GitHub
parent
commit
77087f1c37
No known key found for this signature in database GPG Key ID: 4AEE18F83AFDEB23
  1. 13
      tools/rpi/hoymiles/__main__.py

13
tools/rpi/hoymiles/__main__.py

@ -168,18 +168,7 @@ def poll_inverter(inverter, dtu_ser, do_init, retries):
data = result.__dict__() data = result.__dict__()
if hoymiles.HOYMILES_DEBUG_LOGGING: if hoymiles.HOYMILES_DEBUG_LOGGING:
dbg = f'{c_datetime} Decoded: temp={data["temperature"]}, total={data["energy_total"]/1000:.3f}' logging.debug(f'{c_datetime} Decoded: {result.__dict__()}')
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)
if 'event_count' in data: if 'event_count' in data:
if event_message_index[inv_str] < data['event_count']: if event_message_index[inv_str] < data['event_count']:

Loading…
Cancel
Save