Skip to content

Commit

Permalink
Fix lyric feedback (#100586)
Browse files Browse the repository at this point in the history
  • Loading branch information
joostlek authored Sep 19, 2023
1 parent cf6edde commit f01c71e
Showing 1 changed file with 7 additions and 5 deletions.
12 changes: 7 additions & 5 deletions homeassistant/components/lyric/sensor.py
Original file line number Diff line number Diff line change
Expand Up @@ -98,8 +98,9 @@ class 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",
Expand All @@ -109,8 +110,9 @@ class 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
),
),
]

Expand All @@ -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:
Expand Down

0 comments on commit f01c71e

Please sign in to comment.