Closed TheLion closed 1 year ago
the result will be in a dict where you have to find the device you are looking for. I guess what you get stuck on is that there is a list of devices under ["data"]["installation"]["doorWindows"] You need to iterate through this list in order to find the device.
Something like this:
for door_window in result["data"]["installation"]["doorWindows"]:
if door_window["device"]["deviceLabel"] == "XXXX XXXX":
return doow_window["state"]
(written on free hand, but I hope you get the point)
Thanks! That works like a charm!
Hi,
I'm rewriting my Python script to work with the new API, but I can't figure out how to get a single value, like, for example, the state of a door/window.
I manage to output the complete doorWindows status, but I only need a single one and only the status.
With the old API/version I used
overview['doorWindow']['doorWindowDevice'][0]['state']
But that doesn't work anymore.
Can anyone point me in the right direction?