Add scene support

This commit is contained in:
2022-10-20 17:27:31 +02:00
parent bdd6ab840c
commit 071aa7a9ac
8 changed files with 107 additions and 19 deletions

View File

@@ -103,3 +103,18 @@ async def get_devices(**credentials):
}
return retval
async def get_scenes(**credentials):
site_data = await get_site_data(**credentials)
retval = []
for scene in site_data["scenes"]:
if scene["hiddenFromSceneList"]: continue
sceneId = scene["sceneId"]
index = site_data["sceneIndex"].get(sceneId)
retval.append({
"index": index,
"title": scene["title"],
})
return retval