Skip to content

Commit

Permalink
Move out of loop
Browse files Browse the repository at this point in the history
  • Loading branch information
timmo001 committed Aug 21, 2021
1 parent f75be22 commit 22c716b
Showing 1 changed file with 5 additions and 6 deletions.
11 changes: 5 additions & 6 deletions homeassistant/components/lyric/sensor.py
Original file line number Diff line number Diff line change
Expand Up @@ -64,6 +64,11 @@ async def async_setup_entry(

entities = []

def get_setpoint_status(status: str, time: str) -> str:
if status == PRESET_HOLD_UNTIL:
return f"Held until {time}"
return LYRIC_SETPOINT_STATUS_NAMES.get(status, None)

for location in coordinator.data.locations:
for device in location.devices:
if device.indoorTemperature:
Expand Down Expand Up @@ -132,12 +137,6 @@ async def async_setup_entry(
)
)
if device.changeableValues.thermostatSetpointStatus:

def get_setpoint_status(status: str, time: str) -> str:
if status == PRESET_HOLD_UNTIL:
return f"Held until {time}"
return LYRIC_SETPOINT_STATUS_NAMES.get(status, None)

entities.append(
LyricSensor(
coordinator,
Expand Down

0 comments on commit 22c716b

Please sign in to comment.