Skip to content
Draft
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
18 changes: 18 additions & 0 deletions pyoverkiz/client.py
Original file line number Diff line number Diff line change
Expand Up @@ -70,6 +70,7 @@
UnknownUserException,
)
from pyoverkiz.models import (
Action,
Command,
Device,
Event,
Expand Down Expand Up @@ -679,6 +680,23 @@ async def execute_commands(
response: dict = await self.__post("exec/apply", payload)
return cast(str, response["execId"])

@retry_on_auth_error
async def execute_actions(
self,
actions: list[Action],
label: str | None = "python-overkiz-api",
) -> str:
"""Send several commands to different devices in one call"""
payload = {
"label": label,
"actions": [
{"deviceURL": action.device_url, "commands": action.commands}
for action in actions
],
}
response: dict = await self.__post("exec/apply", payload)
return cast(str, response["execId"])

@retry_on_auth_error
async def get_scenarios(self) -> list[Scenario]:
"""List the scenarios"""
Expand Down