mirror of
https://github.com/home-assistant/core.git
synced 2026-02-15 07:36:16 +00:00
Fix lamarzocco brewing start time sensor availability (#153732)
This commit is contained in:
@@ -5,7 +5,7 @@ from dataclasses import dataclass
|
||||
from datetime import datetime
|
||||
from typing import cast
|
||||
|
||||
from pylamarzocco.const import BackFlushStatus, ModelName, WidgetType
|
||||
from pylamarzocco.const import BackFlushStatus, MachineState, ModelName, WidgetType
|
||||
from pylamarzocco.models import (
|
||||
BackFlush,
|
||||
BaseWidgetOutput,
|
||||
@@ -97,7 +97,14 @@ ENTITIES: tuple[LaMarzoccoSensorEntityDescription, ...] = (
|
||||
).brewing_start_time
|
||||
),
|
||||
entity_category=EntityCategory.DIAGNOSTIC,
|
||||
available_fn=(lambda coordinator: not coordinator.websocket_terminated),
|
||||
available_fn=(
|
||||
lambda coordinator: not coordinator.websocket_terminated
|
||||
and cast(
|
||||
MachineStatus,
|
||||
coordinator.device.dashboard.config[WidgetType.CM_MACHINE_STATUS],
|
||||
).status
|
||||
is MachineState.BREWING
|
||||
),
|
||||
),
|
||||
LaMarzoccoSensorEntityDescription(
|
||||
key="steam_boiler_ready_time",
|
||||
|
||||
@@ -45,7 +45,7 @@
|
||||
'last_changed': <ANY>,
|
||||
'last_reported': <ANY>,
|
||||
'last_updated': <ANY>,
|
||||
'state': '2025-05-07T18:04:20+00:00',
|
||||
'state': 'unavailable',
|
||||
})
|
||||
# ---
|
||||
# name: test_sensors[sensor.gs012345_coffee_boiler_ready_time-entry]
|
||||
|
||||
Reference in New Issue
Block a user