Skip to content

Commit 5e31b5a

Browse files
authored
Handle missing widget in lamarzocco (home-assistant#147047)
1 parent 81257f9 commit 5e31b5a

File tree

2 files changed

+9
-1
lines changed

2 files changed

+9
-1
lines changed

homeassistant/components/lamarzocco/number.py

Lines changed: 5 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -58,6 +58,10 @@ class LaMarzoccoNumberEntityDescription(
5858
CoffeeBoiler, machine.dashboard.config[WidgetType.CM_COFFEE_BOILER]
5959
).target_temperature
6060
),
61+
available_fn=(
62+
lambda coordinator: WidgetType.CM_COFFEE_BOILER
63+
in coordinator.device.dashboard.config
64+
),
6165
),
6266
LaMarzoccoNumberEntityDescription(
6367
key="smart_standby_time",
@@ -221,7 +225,7 @@ class LaMarzoccoNumberEntity(LaMarzoccoEntity, NumberEntity):
221225
entity_description: LaMarzoccoNumberEntityDescription
222226

223227
@property
224-
def native_value(self) -> float:
228+
def native_value(self) -> float | int:
225229
"""Return the current value."""
226230
return self.entity_description.native_value_fn(self.coordinator.device)
227231

homeassistant/components/lamarzocco/sensor.py

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -57,6 +57,10 @@ class LaMarzoccoSensorEntityDescription(
5757
).ready_start_time
5858
),
5959
entity_category=EntityCategory.DIAGNOSTIC,
60+
available_fn=(
61+
lambda coordinator: WidgetType.CM_COFFEE_BOILER
62+
in coordinator.device.dashboard.config
63+
),
6064
),
6165
LaMarzoccoSensorEntityDescription(
6266
key="steam_boiler_ready_time",

0 commit comments

Comments
 (0)