Skip to content

Commit

Permalink
Fix battery unavailable
Browse files Browse the repository at this point in the history
  • Loading branch information
andrew-codechimp committed Jan 26, 2024
1 parent 1dab971 commit 9f8dda4
Showing 1 changed file with 1 addition and 1 deletion.
2 changes: 1 addition & 1 deletion custom_components/battery_notes/binary_sensor.py
Original file line number Diff line number Diff line change
Expand Up @@ -238,7 +238,7 @@ async def async_state_changed_listener(

if (
wrapped_battery_state := self.hass.states.get(self._battery_entity_id)
) is None or wrapped_battery_state.state == STATE_UNAVAILABLE:
) is None or wrapped_battery_state.state in [STATE_UNAVAILABLE, STATE_UNKNOWN]:
self._attr_is_on = False
self._attr_available = True
return
Expand Down

0 comments on commit 9f8dda4

Please sign in to comment.