Skip to content
Open
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 pyControl4/director.py
Original file line number Diff line number Diff line change
Expand Up @@ -228,6 +228,24 @@ async def get_item_commands(self, item_id: int) -> list[dict[str, Any]]:
result: list[dict[str, Any]] = json.loads(data)
return result

async def send_command(
self, item_id: int, command: str, params: dict[str, Any] | None = None
) -> str:
"""Sends a command to the specified item.

Parameters:
`item_id` - The Control4 item ID.

`command` - The Control4 command to send.

`params` - The parameters of the command, provided as a dictionary.
"""
if params is None:
params = {}
return await self.send_post_request(
f"/api/v1/items/{item_id}/commands", command, params
)

async def get_item_network(self, item_id: int) -> list[dict[str, Any]]:
"""Returns the network information for the specified item.

Expand Down
Loading