mirror of
https://github.com/home-assistant/core.git
synced 2025-07-19 11:17:21 +00:00
Verisure unpack (#98605)
This commit is contained in:
parent
d3ee2366b0
commit
89705a22cf
@ -83,13 +83,16 @@ class VerisureDataUpdateCoordinator(DataUpdateCoordinator):
|
||||
raise UpdateFailed("Could not read overview") from err
|
||||
|
||||
def unpack(overview: list, value: str) -> dict | list:
|
||||
return next(
|
||||
(
|
||||
item["data"]["installation"][value]
|
||||
for item in overview
|
||||
if value in item.get("data", {}).get("installation", {})
|
||||
),
|
||||
[],
|
||||
return (
|
||||
next(
|
||||
(
|
||||
item["data"]["installation"][value]
|
||||
for item in overview
|
||||
if value in item.get("data", {}).get("installation", {})
|
||||
),
|
||||
[],
|
||||
)
|
||||
or []
|
||||
)
|
||||
|
||||
# Store data in a way Home Assistant can easily consume it
|
||||
|
Loading…
x
Reference in New Issue
Block a user