Adjust is_on

pull/73820/head
epenet 2022-06-22 09:52:34 +00:00
parent 50ee51aaf9
commit 48d207f250
1 changed files with 3 additions and 2 deletions

View File

@ -80,10 +80,11 @@ class NotValidPresetModeError(ValueError):
@bind_hass
def is_on(hass: HomeAssistant, entity_id: str) -> bool:
def is_on(hass: HomeAssistant, entity_id: str) -> bool | None:
"""Return if the fans are on based on the statemachine."""
entity = hass.states.get(entity_id)
assert entity
if entity is None:
return None
return entity.state == STATE_ON