Skip to content

Commit 34e5526

Browse files
authored
Unwrap zone states (#106)
1 parent 80fa54e commit 34e5526

File tree

2 files changed

+675
-688
lines changed

2 files changed

+675
-688
lines changed

src/tadoasync/tadoasync.py

Lines changed: 2 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -53,7 +53,6 @@
5353
Weather,
5454
Zone,
5555
ZoneState,
56-
ZoneStates,
5756
)
5857

5958
CLIENT_ID = "tado-web-app"
@@ -242,7 +241,7 @@ async def get_zones(self) -> list[Zone]:
242241
obj = orjson.loads(response)
243242
return [Zone.from_dict(zone) for zone in obj]
244243

245-
async def get_zone_states(self) -> list[ZoneStates]:
244+
async def get_zone_states(self) -> dict[str, ZoneState]:
246245
"""Get the zone states."""
247246
response = await self._request(f"homes/{self._home_id}/zoneStates")
248247
obj = orjson.loads(response)
@@ -254,7 +253,7 @@ async def get_zone_states(self) -> list[ZoneStates]:
254253
for zone_state in zone_states.values():
255254
await self.update_zone_data(zone_state)
256255

257-
return [ZoneStates(zone_states=zone_states)]
256+
return zone_states
258257

259258
async def get_zone_state(self, zone_id: int) -> ZoneState:
260259
"""Get the zone state."""

0 commit comments

Comments
 (0)