Browse Source

fixed NoneType access

pull/1205/head
vendetta 2 years ago
parent
commit
b475c34878
  1. 2
      tools/rpi/hoymiles/__main__.py

2
tools/rpi/hoymiles/__main__.py

@ -236,7 +236,7 @@ def poll_inverter(inverter, dtu_ser, do_init, retries):
if isinstance(result, hoymiles.decoders.StatusResponse):
data = result.__dict__()
if 'event_count' in data:
if data is not None and 'event_count' in data:
if event_message_index[inv_str] < data['event_count']:
event_message_index[inv_str] = data['event_count']
command_queue[inv_str].append(hoymiles.compose_send_time_payload(InfoCommands.AlarmData, alarm_id=event_message_index[inv_str]))

Loading…
Cancel
Save