diff --git a/homeassistant/components/lamarzocco/sensor.py b/homeassistant/components/lamarzocco/sensor.py index a432f5b8dae..1f4983a03a8 100644 --- a/homeassistant/components/lamarzocco/sensor.py +++ b/homeassistant/components/lamarzocco/sensor.py @@ -56,6 +56,13 @@ ENTITIES: tuple[LaMarzoccoSensorEntityDescription, ...] = ( CoffeeBoiler, config[WidgetType.CM_COFFEE_BOILER] ).ready_start_time ), + available_fn=( + lambda coordinator: cast( + CoffeeBoiler, + coordinator.device.dashboard.config[WidgetType.CM_COFFEE_BOILER], + ).ready_start_time + is not None + ), entity_category=EntityCategory.DIAGNOSTIC, ), LaMarzoccoSensorEntityDescription( @@ -67,11 +74,18 @@ ENTITIES: tuple[LaMarzoccoSensorEntityDescription, ...] = ( SteamBoilerLevel, config[WidgetType.CM_STEAM_BOILER_LEVEL] ).ready_start_time ), - entity_category=EntityCategory.DIAGNOSTIC, supported_fn=( lambda coordinator: coordinator.device.dashboard.model_name in (ModelName.LINEA_MICRA, ModelName.LINEA_MINI_R) ), + available_fn=( + lambda coordinator: cast( + SteamBoilerLevel, + coordinator.device.dashboard.config[WidgetType.CM_STEAM_BOILER_LEVEL], + ).ready_start_time + is not None + ), + entity_category=EntityCategory.DIAGNOSTIC, ), LaMarzoccoSensorEntityDescription( key="brewing_start_time", diff --git a/tests/components/lamarzocco/snapshots/test_sensor.ambr b/tests/components/lamarzocco/snapshots/test_sensor.ambr index eea4616d0ff..3dd1ff9b665 100644 --- a/tests/components/lamarzocco/snapshots/test_sensor.ambr +++ b/tests/components/lamarzocco/snapshots/test_sensor.ambr @@ -94,7 +94,7 @@ 'last_changed': , 'last_reported': , 'last_updated': , - 'state': 'unknown', + 'state': 'unavailable', }) # --- # name: test_sensors[sensor.gs012345_last_cleaning_time-entry]