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] = [ ...@@ -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] = [ ...@@ -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: ...@@ -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:
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Please register or to comment