diff --git a/homeassistant/components/fan/__init__.py b/homeassistant/components/fan/__init__.py index 55732041131..32baa5099c5 100644 --- a/homeassistant/components/fan/__init__.py +++ b/homeassistant/components/fan/__init__.py @@ -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