Skip to content
Snippets Groups Projects
Unverified Commit f01c71e5 authored by Joost Lekkerkerker's avatar Joost Lekkerkerker Committed by GitHub
Browse files

Fix lyric feedback (#100586)

parent cf6eddee
No related branches found
No related tags found
No related merge requests found
......@@ -98,8 +98,9 @@ DEVICE_SENSORS: list[LyricSensorEntityDescription] = [
value_fn=lambda device: get_datetime_from_future_time(
device.changeableValues.nextPeriodTime
),
suitable_fn=lambda device: device.changeableValues
and device.changeableValues.nextPeriodTime,
suitable_fn=lambda device: (
device.changeableValues and device.changeableValues.nextPeriodTime
),
),
LyricSensorEntityDescription(
key="setpoint_status",
......@@ -109,8 +110,9 @@ DEVICE_SENSORS: list[LyricSensorEntityDescription] = [
device.changeableValues.thermostatSetpointStatus,
device.changeableValues.nextPeriodTime,
),
suitable_fn=lambda device: device.changeableValues
and device.changeableValues.thermostatSetpointStatus,
suitable_fn=lambda device: (
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."""
if status == PRESET_HOLD_UNTIL:
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:
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment