Skip to content

Commit

Permalink
Fix alarm interpretation
Browse files Browse the repository at this point in the history
Fixed the attribute list in `parse_teledata_info` by removing
extra `alarmEvent0` and updating rest of alarm events according
to Seplos specification document.

Fixes flip555#76.
  • Loading branch information
sofkaski committed May 5, 2024
1 parent 1347510 commit 29d072d
Showing 1 changed file with 1 addition and 1 deletion.
Original file line number Diff line number Diff line change
Expand Up @@ -71,7 +71,7 @@ def remaining_length():
result.tempAlarm.append(int(info_str[cursor:cursor+2], 16))
cursor += 2

for attribute in ['currentAlarm', 'voltageAlarm', 'customAlarms', 'alarmEvent0', 'alarmEvent1', 'alarmEvent2', 'alarmEvent3', 'alarmEvent4', 'alarmEvent5', 'onOffState', 'equilibriumState0', 'equilibriumState1', 'systemState', 'disconnectionState0', 'disconnectionState1', 'alarmEvent6', 'alarmEvent7']:
for attribute in ['currentAlarm', 'voltageAlarm', 'customAlarms', 'alarmEvent1', 'alarmEvent2', 'alarmEvent3', 'alarmEvent4', 'alarmEvent5', 'alarmEvent6', 'onOffState', 'equilibriumState0', 'equilibriumState1', 'systemState', 'disconnectionState0', 'disconnectionState1', 'alarmEvent7', 'alarmEvent8']:
if remaining_length() < 2:
return result
setattr(result, attribute, int(info_str[cursor:cursor+2], 16))
Expand Down

0 comments on commit 29d072d

Please sign in to comment.