Skip to content

Commit 9f8dda4

Browse files
Fix battery unavailable
1 parent 1dab971 commit 9f8dda4

File tree

1 file changed

+1
-1
lines changed

1 file changed

+1
-1
lines changed

custom_components/battery_notes/binary_sensor.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -238,7 +238,7 @@ async def async_state_changed_listener(
238238

239239
if (
240240
wrapped_battery_state := self.hass.states.get(self._battery_entity_id)
241-
) is None or wrapped_battery_state.state == STATE_UNAVAILABLE:
241+
) is None or wrapped_battery_state.state in [STATE_UNAVAILABLE, STATE_UNKNOWN]:
242242
self._attr_is_on = False
243243
self._attr_available = True
244244
return

0 commit comments

Comments
 (0)