mirror of
https://github.com/home-assistant/core.git
synced 2025-07-16 01:37:08 +00:00
Fix lyric feedback (#100586)
This commit is contained in:
parent
cf6eddee74
commit
f01c71e514
@ -98,8 +98,9 @@ DEVICE_SENSORS: list[LyricSensorEntityDescription] = [
|
|||||||
value_fn=lambda device: get_datetime_from_future_time(
|
value_fn=lambda device: get_datetime_from_future_time(
|
||||||
device.changeableValues.nextPeriodTime
|
device.changeableValues.nextPeriodTime
|
||||||
),
|
),
|
||||||
suitable_fn=lambda device: device.changeableValues
|
suitable_fn=lambda device: (
|
||||||
and device.changeableValues.nextPeriodTime,
|
device.changeableValues and device.changeableValues.nextPeriodTime
|
||||||
|
),
|
||||||
),
|
),
|
||||||
LyricSensorEntityDescription(
|
LyricSensorEntityDescription(
|
||||||
key="setpoint_status",
|
key="setpoint_status",
|
||||||
@ -109,8 +110,9 @@ DEVICE_SENSORS: list[LyricSensorEntityDescription] = [
|
|||||||
device.changeableValues.thermostatSetpointStatus,
|
device.changeableValues.thermostatSetpointStatus,
|
||||||
device.changeableValues.nextPeriodTime,
|
device.changeableValues.nextPeriodTime,
|
||||||
),
|
),
|
||||||
suitable_fn=lambda device: device.changeableValues
|
suitable_fn=lambda device: (
|
||||||
and device.changeableValues.thermostatSetpointStatus,
|
device.changeableValues and device.changeableValues.thermostatSetpointStatus
|
||||||
|
),
|
||||||
),
|
),
|
||||||
]
|
]
|
||||||
|
|
||||||
@ -119,7 +121,7 @@ def get_setpoint_status(status: str, time: str) -> str | None:
|
|||||||
"""Get status of the setpoint."""
|
"""Get status of the setpoint."""
|
||||||
if status == PRESET_HOLD_UNTIL:
|
if status == PRESET_HOLD_UNTIL:
|
||||||
return f"Held until {time}"
|
return f"Held until {time}"
|
||||||
return LYRIC_SETPOINT_STATUS_NAMES.get(status, None)
|
return LYRIC_SETPOINT_STATUS_NAMES.get(status)
|
||||||
|
|
||||||
|
|
||||||
def get_datetime_from_future_time(time_str: str) -> datetime:
|
def get_datetime_from_future_time(time_str: str) -> datetime:
|
||||||
|
Loading…
x
Reference in New Issue
Block a user