From dd6c5e89efdd38279cacd6bf875fd2cb5b085bc5 Mon Sep 17 00:00:00 2001 From: Joost Lekkerkerker Date: Thu, 4 Jan 2024 09:13:34 +0100 Subject: [PATCH] Fix data access in streamlabs water (#107062) * Fix data access in streamlabs water * Fix data access in streamlabs water --- homeassistant/components/streamlabswater/coordinator.py | 2 +- homeassistant/components/streamlabswater/sensor.py | 2 +- 2 files changed, 2 insertions(+), 2 deletions(-) diff --git a/homeassistant/components/streamlabswater/coordinator.py b/homeassistant/components/streamlabswater/coordinator.py index a11eced5a6e5c7..dc57ae78810a52 100644 --- a/homeassistant/components/streamlabswater/coordinator.py +++ b/homeassistant/components/streamlabswater/coordinator.py @@ -44,7 +44,7 @@ async def _async_update_data(self) -> dict[str, StreamlabsData]: def _update_data(self) -> dict[str, StreamlabsData]: locations = self.client.get_locations() res = {} - for location in locations: + for location in locations["locations"]: location_id = location["locationId"] water_usage = self.client.get_water_usage_summary(location_id) res[location_id] = StreamlabsData( diff --git a/homeassistant/components/streamlabswater/sensor.py b/homeassistant/components/streamlabswater/sensor.py index 0b249b7c4e54b7..6c869a6d1bc959 100644 --- a/homeassistant/components/streamlabswater/sensor.py +++ b/homeassistant/components/streamlabswater/sensor.py @@ -27,7 +27,7 @@ async def async_setup_entry( entities = [] - for location_id in coordinator.data.values(): + for location_id in coordinator.data: entities.extend( [ StreamLabsDailyUsage(coordinator, location_id),