diff --git a/README.md b/README.md index d20df45b..72143378 100644 --- a/README.md +++ b/README.md @@ -30,8 +30,9 @@ Full documentation is available at **[imicknl.github.io/python-overkiz-api](http - Somfy TaHoma Switch - Thermor Cozytouch -\[*] _This server's authentication method isn't supported yet. To use it, obtain an access token (by sniffing the original app) and create a local user on the Overkiz API platform._ -\[**] _Requires OAuth credentials provided by Rexel._ +**\*** _This server's authentication method isn't supported yet. To use it, obtain an access token (by sniffing the original app) and create a local user on the Overkiz API platform._ + +**\*\*** _Requires OAuth credentials provided by Rexel._ ## Installation diff --git a/docs/action-queue.md b/docs/action-queue.md index 6fa2e907..abe4621c 100644 --- a/docs/action-queue.md +++ b/docs/action-queue.md @@ -18,9 +18,9 @@ Three commands for three different devices produce three actions in one action g ```python # These three calls arrive within the delay window: -await client.execute_action_group([Action(device_url="io://1234-5678-1234/12345678", commands=[Command(name=OverkizCommand.CLOSE)])]) -await client.execute_action_group([Action(device_url="io://1234-5678-1234/87654321", commands=[Command(name=OverkizCommand.OPEN)])]) -await client.execute_action_group([Action(device_url="io://1234-5678-1234/11111111", commands=[Command(name=OverkizCommand.STOP)])]) +await client.execute_action_group(actions=[Action(device_url="io://1234-5678-1234/12345678", commands=[Command(name=OverkizCommand.CLOSE)])]) +await client.execute_action_group(actions=[Action(device_url="io://1234-5678-1234/87654321", commands=[Command(name=OverkizCommand.OPEN)])]) +await client.execute_action_group(actions=[Action(device_url="io://1234-5678-1234/11111111", commands=[Command(name=OverkizCommand.STOP)])]) # Sent as one API call: # ActionGroup(actions=[ @@ -35,8 +35,8 @@ await client.execute_action_group([Action(device_url="io://1234-5678-1234/111111 When two calls target the same device, the queue merges their commands into a single action: ```python -await client.execute_action_group([Action(device_url="io://1234-5678-1234/12345678", commands=[Command(name=OverkizCommand.CLOSE)])]) -await client.execute_action_group([Action(device_url="io://1234-5678-1234/12345678", commands=[Command(name=OverkizCommand.SET_CLOSURE, parameters=[50])])]) +await client.execute_action_group(actions=[Action(device_url="io://1234-5678-1234/12345678", commands=[Command(name=OverkizCommand.CLOSE)])]) +await client.execute_action_group(actions=[Action(device_url="io://1234-5678-1234/12345678", commands=[Command(name=OverkizCommand.SET_CLOSURE, parameters=[50])])]) # Sent as one API call: # ActionGroup(actions=[ @@ -47,8 +47,8 @@ await client.execute_action_group([Action(device_url="io://1234-5678-1234/123456 ### Mixed — both behaviors combined ```python -await client.execute_action_group([Action(device_url="io://1234-5678-1234/12345678", commands=[Command(name=OverkizCommand.CLOSE)])]) -await client.execute_action_group([ +await client.execute_action_group(actions=[Action(device_url="io://1234-5678-1234/12345678", commands=[Command(name=OverkizCommand.CLOSE)])]) +await client.execute_action_group(actions=[ Action(device_url="io://1234-5678-1234/87654321", commands=[Command(name=OverkizCommand.OPEN)]), Action(device_url="io://1234-5678-1234/12345678", commands=[Command(name=OverkizCommand.SET_CLOSURE, parameters=[50])]), ]) @@ -91,8 +91,8 @@ action2 = Action( commands=[Command(name=OverkizCommand.OPEN)], ) -task1 = asyncio.create_task(client.execute_action_group([action1])) -task2 = asyncio.create_task(client.execute_action_group([action2])) +task1 = asyncio.create_task(client.execute_action_group(actions=[action1])) +task2 = asyncio.create_task(client.execute_action_group(actions=[action2])) exec_id1, exec_id2 = await asyncio.gather(task1, task2) print(exec_id1 == exec_id2) @@ -160,7 +160,7 @@ action = Action( commands=[Command(name=OverkizCommand.CLOSE)], ) -exec_task = asyncio.create_task(client.execute_action_group([action])) +exec_task = asyncio.create_task(client.execute_action_group(actions=[action])) # Give it time to enter the queue await asyncio.sleep(0.05) @@ -199,7 +199,7 @@ action = Action( commands=[Command(name=OverkizCommand.CLOSE)], ) -exec_task = asyncio.create_task(client.execute_action_group([action])) +exec_task = asyncio.create_task(client.execute_action_group(actions=[action])) await asyncio.sleep(0.01) pending = client.get_pending_actions_count() diff --git a/docs/index.md b/docs/index.md index 69c13228..ff836a9e 100644 --- a/docs/index.md +++ b/docs/index.md @@ -36,5 +36,6 @@ pyOverkiz is an async Python library for interacting with Overkiz-based platform - Somfy TaHoma Switch - Thermor Cozytouch -\[*] _This server's authentication method isn't supported yet. To use it, obtain an access token (by sniffing the original app) and create a local user on the Overkiz API platform._ -\[**] _Requires OAuth credentials provided by Rexel._ +**\*** _This server's authentication method isn't supported yet. To use it, obtain an access token (by sniffing the original app) and create a local user on the Overkiz API platform._ + +**\*\*** _Requires OAuth credentials provided by Rexel._ diff --git a/docs/migration-v2.md b/docs/migration-v2.md index 720183d8..6541d431 100644 --- a/docs/migration-v2.md +++ b/docs/migration-v2.md @@ -110,6 +110,8 @@ The command execution API has been consolidated into a single method. ) ``` +`execute_action_group()` is keyword-only — pass `actions=[...]` (and optional `mode=`/`label=`) by name, not positionally. + v2 also supports sending actions to **multiple devices** in a single call and choosing an `ExecutionMode` (`HIGH_PRIORITY`, `GEOLOCATED`, `INTERNAL`). Execution modes are only supported by the Cloud API; the local API rejects them (see [Somfy-TaHoma-Developer-Mode#227](https://github.com/Somfy-Developer/Somfy-TaHoma-Developer-Mode/issues/227)). ### `Command` is no longer a `dict` diff --git a/pyoverkiz/client.py b/pyoverkiz/client.py index e56de07d..836761a9 100644 --- a/pyoverkiz/client.py +++ b/pyoverkiz/client.py @@ -595,6 +595,7 @@ async def _execute_action_group_direct( async def execute_action_group( self, + *, actions: list[Action], mode: ExecutionMode | None = None, label: str | None = "pyOverkiz", @@ -906,17 +907,25 @@ async def get_device_manufacturer_references( return converter.structure(response, list[DeviceManufacturerReference]) async def discover_gateways(self) -> list[GatewayCandidate]: - """Discover selectable gateways. Raises TypeError if unsupported.""" + """Discover selectable gateways. + + Raises: + UnsupportedOperationError: When the server does not support gateway selection. + """ if not isinstance(self._auth, SupportsGatewaySelection): - raise TypeError( + raise UnsupportedOperationError( f"{self.server_config.name} does not support gateway selection." ) return await self._auth.discover_gateways() def select_gateway(self, gateway_id: str) -> None: - """Select the gateway to scope requests to. Raises TypeError if unsupported.""" + """Select the gateway to scope requests to. + + Raises: + UnsupportedOperationError: When the server does not support gateway selection. + """ if not isinstance(self._auth, SupportsGatewaySelection): - raise TypeError( + raise UnsupportedOperationError( f"{self.server_config.name} does not support gateway selection." ) self._auth.select_gateway(gateway_id) @@ -972,6 +981,10 @@ async def open_local_pairing(self, gateway_id: str) -> Any: During this window, new tokens can be registered directly on the gateway without requiring developer mode. + Returns the raw response. Observed as an empty dict on success, but the + shape under other conditions is not yet confirmed, so the response is + passed through as-is. + .. warning:: Experimental (preview). This endpoint is not yet fully validated and its behaviour or signature may change in a future release. diff --git a/tests/test_client.py b/tests/test_client.py index 84725675..c70a62bd 100644 --- a/tests/test_client.py +++ b/tests/test_client.py @@ -753,7 +753,7 @@ async def test_execute_action_group_omits_none_fields(self, client: OverkizClien with patch.object(aiohttp.ClientSession, "post") as mock_post: mock_post.return_value = resp - exec_id = await client.execute_action_group([action]) + exec_id = await client.execute_action_group(actions=[action]) assert exec_id == "exec-123" @@ -981,7 +981,7 @@ async def test_execute_action_group_rts_close(self, client: OverkizClient): with patch.object(aiohttp.ClientSession, "post") as mock_post: mock_post.return_value = resp - exec_id = await client.execute_action_group([action]) + exec_id = await client.execute_action_group(actions=[action]) assert exec_id == "ee7a5676-c68f-43a3-956d-6f5efc745954" _, kwargs = mock_post.call_args @@ -1010,7 +1010,7 @@ async def test_execute_action_group_multiple_rts_devices( with patch.object(aiohttp.ClientSession, "post") as mock_post: mock_post.return_value = resp - exec_id = await client.execute_action_group(actions) + exec_id = await client.execute_action_group(actions=actions) assert exec_id == "aaa-bbb-ccc" _, kwargs = mock_post.call_args @@ -1200,7 +1200,7 @@ async def test_local_execute_action_group_rts_close( with patch.object(aiohttp.ClientSession, "post") as mock_post: mock_post.return_value = resp - exec_id = await local_client.execute_action_group([action]) + exec_id = await local_client.execute_action_group(actions=[action]) assert exec_id == "45e52d27-3c08-4fd5-87f2-03d650b67f4b" @@ -1255,9 +1255,12 @@ async def test_discover_gateways_delegates_to_strategy( async def test_discover_gateways_raises_for_unsupported_strategy( self, client: OverkizClient ) -> None: - """discover_gateways raises TypeError when the strategy lacks the capability.""" + """discover_gateways raises UnsupportedOperationError when the strategy lacks the capability.""" # The default Somfy strategy does not implement SupportsGatewaySelection. - with pytest.raises(TypeError, match="does not support gateway selection"): + with pytest.raises( + exceptions.UnsupportedOperationError, + match="does not support gateway selection", + ): await client.discover_gateways() def test_select_gateway_delegates_to_strategy(self, client: OverkizClient) -> None: diff --git a/tests/test_client_queue_integration.py b/tests/test_client_queue_integration.py index 95833955..1a0b7c86 100644 --- a/tests/test_client_queue_integration.py +++ b/tests/test_client_queue_integration.py @@ -29,7 +29,7 @@ async def test_client_without_queue_executes_immediately(): with patch.object(client, "_post", new_callable=AsyncMock) as mock_post: mock_post.return_value = {"execId": "exec-123"} - result = await client.execute_action_group([action]) + result = await client.execute_action_group(actions=[action]) # Should return exec_id directly (string) assert isinstance(result, str) @@ -62,9 +62,9 @@ async def test_client_with_queue_batches_actions(): mock_post.return_value = {"execId": "exec-batched"} # Queue multiple actions quickly - start them as tasks to allow batching - task1 = asyncio.create_task(client.execute_action_group([actions[0]])) - task2 = asyncio.create_task(client.execute_action_group([actions[1]])) - task3 = asyncio.create_task(client.execute_action_group([actions[2]])) + task1 = asyncio.create_task(client.execute_action_group(actions=[actions[0]])) + task2 = asyncio.create_task(client.execute_action_group(actions=[actions[1]])) + task3 = asyncio.create_task(client.execute_action_group(actions=[actions[2]])) # Give them a moment to queue await asyncio.sleep(0.01) @@ -111,7 +111,7 @@ async def test_client_manual_flush(): mock_post.return_value = {"execId": "exec-flushed"} # Start execution as a task to allow checking pending count - exec_task = asyncio.create_task(client.execute_action_group([action])) + exec_task = asyncio.create_task(client.execute_action_group(actions=[action])) # Give it a moment to queue await asyncio.sleep(0.01) @@ -151,7 +151,7 @@ async def test_client_close_flushes_queue(): mock_post.return_value = {"execId": "exec-closed"} # Start execution as a task - exec_task = asyncio.create_task(client.execute_action_group([action])) + exec_task = asyncio.create_task(client.execute_action_group(actions=[action])) # Give it a moment to queue await asyncio.sleep(0.01) @@ -192,8 +192,8 @@ async def test_client_queue_respects_max_actions(): mock_post.return_value = {"execId": "exec-123"} # Add 2 actions as tasks to trigger flush - task1 = asyncio.create_task(client.execute_action_group([actions[0]])) - task2 = asyncio.create_task(client.execute_action_group([actions[1]])) + task1 = asyncio.create_task(client.execute_action_group(actions=[actions[0]])) + task2 = asyncio.create_task(client.execute_action_group(actions=[actions[1]])) # Wait a bit for flush await asyncio.sleep(0.05) @@ -205,7 +205,7 @@ async def test_client_queue_respects_max_actions(): assert exec_id2 == "exec-123" # Add third action - starts new batch - exec_id3 = await client.execute_action_group([actions[2]]) + exec_id3 = await client.execute_action_group(actions=[actions[2]]) # Should have exec_id directly (waited for batch to complete) assert exec_id3 == "exec-123" diff --git a/tests/test_rts_injection.py b/tests/test_rts_injection.py index a6965d45..fa83e038 100644 --- a/tests/test_rts_injection.py +++ b/tests/test_rts_injection.py @@ -173,7 +173,7 @@ async def test_movement_commands_get_duration_injected( client_rts_0, "_execute_action_group_direct", new_callable=AsyncMock ) as mock_exec: mock_exec.return_value = "exec-123" - await client_rts_0.execute_action_group([action]) + await client_rts_0.execute_action_group(actions=[action]) called_actions = mock_exec.call_args[0][0] assert called_actions[0].commands[0].parameters == [0], ( @@ -194,7 +194,7 @@ async def test_custom_duration_value_injected(self, client_rts_5): client_rts_5, "_execute_action_group_direct", new_callable=AsyncMock ) as mock_exec: mock_exec.return_value = "exec-123" - await client_rts_5.execute_action_group([action]) + await client_rts_5.execute_action_group(actions=[action]) called_actions = mock_exec.call_args[0][0] assert called_actions[0].commands[0].parameters == [5] @@ -226,7 +226,7 @@ async def test_zero_nparams_commands_not_injected(self, client_rts_0, command_na client_rts_0, "_execute_action_group_direct", new_callable=AsyncMock ) as mock_exec: mock_exec.return_value = "exec-123" - await client_rts_0.execute_action_group([action]) + await client_rts_0.execute_action_group(actions=[action]) called_actions = mock_exec.call_args[0][0] assert called_actions[0].commands[0].parameters is None, ( @@ -253,7 +253,7 @@ async def test_multi_nparams_no_params_not_injected( client_rts_0, "_execute_action_group_direct", new_callable=AsyncMock ) as mock_exec: mock_exec.return_value = "exec-123" - await client_rts_0.execute_action_group([action]) + await client_rts_0.execute_action_group(actions=[action]) called_actions = mock_exec.call_args[0][0] assert called_actions[0].commands[0].parameters is None, ( @@ -284,7 +284,7 @@ async def test_multi_nparams_fully_filled_not_injected( client_rts_0, "_execute_action_group_direct", new_callable=AsyncMock ) as mock_exec: mock_exec.return_value = "exec-123" - await client_rts_0.execute_action_group([action]) + await client_rts_0.execute_action_group(actions=[action]) called_actions = mock_exec.call_args[0][0] assert called_actions[0].commands[0].parameters == params @@ -328,7 +328,7 @@ async def test_multi_nparams_with_position_gets_duration( client_rts_0, "_execute_action_group_direct", new_callable=AsyncMock ) as mock_exec: mock_exec.return_value = "exec-123" - await client_rts_0.execute_action_group([action]) + await client_rts_0.execute_action_group(actions=[action]) called_actions = mock_exec.call_args[0][0] assert called_actions[0].commands[0].parameters == [*position_param, 0], ( @@ -349,7 +349,7 @@ async def test_tilt_with_custom_duration(self, client_rts_5): client_rts_5, "_execute_action_group_direct", new_callable=AsyncMock ) as mock_exec: mock_exec.return_value = "exec-123" - await client_rts_5.execute_action_group([action]) + await client_rts_5.execute_action_group(actions=[action]) called_actions = mock_exec.call_args[0][0] assert called_actions[0].commands[0].parameters == [100, 5] @@ -387,7 +387,7 @@ async def test_non_rts_device_not_modified( client_rts_0, "_execute_action_group_direct", new_callable=AsyncMock ) as mock_exec: mock_exec.return_value = "exec-123" - await client_rts_0.execute_action_group([action]) + await client_rts_0.execute_action_group(actions=[action]) called_actions = mock_exec.call_args[0][0] assert called_actions[0].commands[0].parameters is None @@ -415,7 +415,7 @@ async def test_no_setting_means_no_injection(self, client_no_rts): client_no_rts, "_execute_action_group_direct", new_callable=AsyncMock ) as mock_exec: mock_exec.return_value = "exec-123" - await client_no_rts.execute_action_group([action]) + await client_no_rts.execute_action_group(actions=[action]) called_actions = mock_exec.call_args[0][0] assert called_actions[0].commands[0].parameters is None @@ -438,7 +438,7 @@ async def test_no_setting_multiple_rts_commands_unmodified(self, client_no_rts): client_no_rts, "_execute_action_group_direct", new_callable=AsyncMock ) as mock_exec: mock_exec.return_value = "exec-123" - await client_no_rts.execute_action_group([action]) + await client_no_rts.execute_action_group(actions=[action]) called_actions = mock_exec.call_args[0][0] for cmd in called_actions[0].commands: @@ -467,7 +467,7 @@ async def test_nparams_1_already_has_param_not_modified(self, client_rts_0): client_rts_0, "_execute_action_group_direct", new_callable=AsyncMock ) as mock_exec: mock_exec.return_value = "exec-123" - await client_rts_0.execute_action_group([action]) + await client_rts_0.execute_action_group(actions=[action]) called_actions = mock_exec.call_args[0][0] assert called_actions[0].commands[0].parameters == [50] @@ -489,7 +489,7 @@ async def test_nparams_1_with_extra_params_not_modified(self, client_rts_0): client_rts_0, "_execute_action_group_direct", new_callable=AsyncMock ) as mock_exec: mock_exec.return_value = "exec-123" - await client_rts_0.execute_action_group([action]) + await client_rts_0.execute_action_group(actions=[action]) called_actions = mock_exec.call_args[0][0] assert called_actions[0].commands[0].parameters == [10, 20] @@ -508,7 +508,7 @@ async def test_empty_parameters_list_counts_as_zero(self, client_rts_0): client_rts_0, "_execute_action_group_direct", new_callable=AsyncMock ) as mock_exec: mock_exec.return_value = "exec-123" - await client_rts_0.execute_action_group([action]) + await client_rts_0.execute_action_group(actions=[action]) called_actions = mock_exec.call_args[0][0] assert called_actions[0].commands[0].parameters == [0] @@ -527,7 +527,7 @@ async def test_nparams_2_with_0_params_not_injected(self, client_rts_0): client_rts_0, "_execute_action_group_direct", new_callable=AsyncMock ) as mock_exec: mock_exec.return_value = "exec-123" - await client_rts_0.execute_action_group([action]) + await client_rts_0.execute_action_group(actions=[action]) called_actions = mock_exec.call_args[0][0] assert called_actions[0].commands[0].parameters is None @@ -546,7 +546,7 @@ async def test_nparams_2_with_1_param_gets_injection(self, client_rts_0): client_rts_0, "_execute_action_group_direct", new_callable=AsyncMock ) as mock_exec: mock_exec.return_value = "exec-123" - await client_rts_0.execute_action_group([action]) + await client_rts_0.execute_action_group(actions=[action]) called_actions = mock_exec.call_args[0][0] assert called_actions[0].commands[0].parameters == [50, 0] @@ -565,7 +565,7 @@ async def test_nparams_2_with_2_params_not_injected(self, client_rts_0): client_rts_0, "_execute_action_group_direct", new_callable=AsyncMock ) as mock_exec: mock_exec.return_value = "exec-123" - await client_rts_0.execute_action_group([action]) + await client_rts_0.execute_action_group(actions=[action]) called_actions = mock_exec.call_args[0][0] assert called_actions[0].commands[0].parameters == [50, 5] @@ -598,7 +598,7 @@ async def test_mixed_commands_in_single_action(self, client_rts_0): client_rts_0, "_execute_action_group_direct", new_callable=AsyncMock ) as mock_exec: mock_exec.return_value = "exec-123" - await client_rts_0.execute_action_group([action]) + await client_rts_0.execute_action_group(actions=[action]) cmds = mock_exec.call_args[0][0][0].commands assert cmds[0].parameters == [0] # close: injected @@ -628,7 +628,7 @@ async def test_multiple_actions_mixed_protocols(self, client_rts_0): client_rts_0, "_execute_action_group_direct", new_callable=AsyncMock ) as mock_exec: mock_exec.return_value = "exec-123" - await client_rts_0.execute_action_group(actions) + await client_rts_0.execute_action_group(actions=actions) called_actions = mock_exec.call_args[0][0] assert called_actions[0].commands[0].parameters == [0] # RTS @@ -656,7 +656,7 @@ async def test_multiple_rts_actions(self, client_rts_0): client_rts_0, "_execute_action_group_direct", new_callable=AsyncMock ) as mock_exec: mock_exec.return_value = "exec-123" - await client_rts_0.execute_action_group(actions) + await client_rts_0.execute_action_group(actions=actions) called_actions = mock_exec.call_args[0][0] assert called_actions[0].commands[0].parameters == [0] @@ -686,7 +686,7 @@ async def test_rts_device_with_subsystem_id(self, client_rts_0): client_rts_0, "_execute_action_group_direct", new_callable=AsyncMock ) as mock_exec: mock_exec.return_value = "exec-123" - await client_rts_0.execute_action_group([action]) + await client_rts_0.execute_action_group(actions=[action]) called_actions = mock_exec.call_args[0][0] assert called_actions[0].commands[0].parameters == [0] @@ -706,7 +706,7 @@ async def test_mismatched_subsystem_id_not_found(self, client_rts_0): client_rts_0, "_execute_action_group_direct", new_callable=AsyncMock ) as mock_exec: mock_exec.return_value = "exec-123" - await client_rts_0.execute_action_group([action]) + await client_rts_0.execute_action_group(actions=[action]) called_actions = mock_exec.call_args[0][0] assert called_actions[0].commands[0].parameters is None @@ -734,7 +734,7 @@ async def test_device_not_in_devices_list(self, client_rts_0): client_rts_0, "_execute_action_group_direct", new_callable=AsyncMock ) as mock_exec: mock_exec.return_value = "exec-123" - await client_rts_0.execute_action_group([action]) + await client_rts_0.execute_action_group(actions=[action]) called_actions = mock_exec.call_args[0][0] assert called_actions[0].commands[0].parameters is None @@ -756,7 +756,7 @@ async def test_command_not_in_definitions(self, client_rts_0): client_rts_0, "_execute_action_group_direct", new_callable=AsyncMock ) as mock_exec: mock_exec.return_value = "exec-123" - await client_rts_0.execute_action_group([action]) + await client_rts_0.execute_action_group(actions=[action]) called_actions = mock_exec.call_args[0][0] assert called_actions[0].commands[0].parameters is None @@ -785,7 +785,7 @@ async def test_empty_command_definitions(self, client_rts_0): client_rts_0, "_execute_action_group_direct", new_callable=AsyncMock ) as mock_exec: mock_exec.return_value = "exec-123" - await client_rts_0.execute_action_group([action]) + await client_rts_0.execute_action_group(actions=[action]) called_actions = mock_exec.call_args[0][0] assert called_actions[0].commands[0].parameters is None @@ -799,7 +799,7 @@ async def test_empty_actions_list(self, client_rts_0): client_rts_0, "_execute_action_group_direct", new_callable=AsyncMock ) as mock_exec: mock_exec.return_value = "exec-123" - await client_rts_0.execute_action_group([]) + await client_rts_0.execute_action_group(actions=[]) called_actions = mock_exec.call_args[0][0] assert called_actions == [] @@ -818,7 +818,7 @@ async def test_action_with_empty_commands_list(self, client_rts_0): client_rts_0, "_execute_action_group_direct", new_callable=AsyncMock ) as mock_exec: mock_exec.return_value = "exec-123" - await client_rts_0.execute_action_group([action]) + await client_rts_0.execute_action_group(actions=[action]) called_actions = mock_exec.call_args[0][0] assert called_actions[0].commands == [] @@ -847,7 +847,7 @@ async def test_original_command_not_mutated(self, client_rts_0): client_rts_0, "_execute_action_group_direct", new_callable=AsyncMock ) as mock_exec: mock_exec.return_value = "exec-123" - await client_rts_0.execute_action_group([action]) + await client_rts_0.execute_action_group(actions=[action]) assert original_cmd.parameters is None @@ -867,7 +867,7 @@ async def test_original_action_not_mutated(self, client_rts_0): client_rts_0, "_execute_action_group_direct", new_callable=AsyncMock ) as mock_exec: mock_exec.return_value = "exec-123" - await client_rts_0.execute_action_group(original_actions) + await client_rts_0.execute_action_group(actions=original_actions) assert original_actions[0].commands[0].parameters is None @@ -887,7 +887,7 @@ async def test_original_parameters_list_not_mutated(self, client_rts_0): client_rts_0, "_execute_action_group_direct", new_callable=AsyncMock ) as mock_exec: mock_exec.return_value = "exec-123" - await client_rts_0.execute_action_group([action]) + await client_rts_0.execute_action_group(actions=[action]) called_actions = mock_exec.call_args[0][0] assert called_actions[0].commands[0].parameters == [50, 0] @@ -929,7 +929,7 @@ async def test_movement_commands_no_args(self, client_rts_0): client_rts_0, "_execute_action_group_direct", new_callable=AsyncMock ) as mock_exec: mock_exec.return_value = "exec-123" - await client_rts_0.execute_action_group([action]) + await client_rts_0.execute_action_group(actions=[action]) called_actions = mock_exec.call_args[0][0] assert called_actions[0].commands[0].parameters == [0], ( @@ -955,7 +955,7 @@ async def test_tilt_commands_with_position_get_duration(self, client_rts_0): client_rts_0, "_execute_action_group_direct", new_callable=AsyncMock ) as mock_exec: mock_exec.return_value = "exec-123" - await client_rts_0.execute_action_group([action]) + await client_rts_0.execute_action_group(actions=[action]) called_actions = mock_exec.call_args[0][0] assert called_actions[0].commands[0].parameters == [*position, 0], ( @@ -977,7 +977,7 @@ async def test_tilt_commands_without_position_not_injected(self, client_rts_0): client_rts_0, "_execute_action_group_direct", new_callable=AsyncMock ) as mock_exec: mock_exec.return_value = "exec-123" - await client_rts_0.execute_action_group([action]) + await client_rts_0.execute_action_group(actions=[action]) called_actions = mock_exec.call_args[0][0] assert called_actions[0].commands[0].parameters is None, ( @@ -1018,7 +1018,7 @@ async def test_venetian_blind_zero_nparams_device(self, client_rts_0): client_rts_0, "_execute_action_group_direct", new_callable=AsyncMock ) as mock_exec: mock_exec.return_value = "exec-123" - await client_rts_0.execute_action_group([action]) + await client_rts_0.execute_action_group(actions=[action]) called_actions = mock_exec.call_args[0][0] actual = called_actions[0].commands[0].parameters