Fix passing correct location id to streamlabs water (#107291)

pull/107388/head
Joost Lekkerkerker 2024-01-06 10:50:06 +01:00 committed by GitHub
parent 3086d33261
commit a03ac3ddcd
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
1 changed files with 1 additions and 3 deletions

View File

@ -107,9 +107,7 @@ async def async_setup_entry(hass: HomeAssistant, entry: ConfigEntry) -> bool:
def set_away_mode(service: ServiceCall) -> None:
"""Set the StreamLabsWater Away Mode."""
away_mode = service.data.get(ATTR_AWAY_MODE)
location_id = (
service.data.get(CONF_LOCATION_ID) or list(coordinator.data.values())[0]
)
location_id = service.data.get(CONF_LOCATION_ID) or list(coordinator.data)[0]
client.update_location(location_id, away_mode)
hass.services.async_register(