From f01c71e514866b30d8c31829b6b1e9293258d00d Mon Sep 17 00:00:00 2001 From: Joost Lekkerkerker Date: Tue, 19 Sep 2023 11:40:05 +0200 Subject: [PATCH] Fix lyric feedback (#100586) --- homeassistant/components/lyric/sensor.py | 12 +++++++----- 1 file changed, 7 insertions(+), 5 deletions(-) diff --git a/homeassistant/components/lyric/sensor.py b/homeassistant/components/lyric/sensor.py index 5bab1ffeb6f92c..f0a4cdfbb99e58 100644 --- a/homeassistant/components/lyric/sensor.py +++ b/homeassistant/components/lyric/sensor.py @@ -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", @@ -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 + ), ), ] @@ -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: