Skip to content

Commit

Permalink
Update sensors.py
Browse files Browse the repository at this point in the history
  • Loading branch information
flip555 committed Sep 20, 2023
1 parent 997d117 commit 5a4ba81
Showing 1 changed file with 2 additions and 1 deletion.
3 changes: 2 additions & 1 deletion custom_components/bms_connector/bms/seplos/v2/sensors.py
Original file line number Diff line number Diff line change
Expand Up @@ -259,8 +259,9 @@ def interpret_alarm(self, event, value):

# For other alarm events, interpret them as bit flags
triggered_alarms = [flag for idx, flag in enumerate(flags) if value is not None and value & (1 << idx)]
return ', '.join(str(triggered_alarms)) if triggered_alarms else "No Alarm"
#return ', '.join(str(triggered_alarms)) if triggered_alarms else "No Alarm"

return ', '.join(str(alarm) for alarm in triggered_alarms) if triggered_alarms else "No Alarm"

def __init__(self, coordinator, port, attribute, name, unit=None, icon=None, battery_address=None, sensor_prefix=None):
"""Initialize the sensor."""
Expand Down

0 comments on commit 5a4ba81

Please sign in to comment.