Add OverkizClientSettings for RTS default duration and future extensibility#2018
Merged
Add OverkizClientSettings for RTS default duration and future extensibility#2018
Conversation
Add OverkizClientSettings to group behavioral configuration for OverkizClient. Includes action_queue (ActionQueueSettings | None) and rts_command_duration (int | None). This replaces the standalone action_queue constructor param and enables RTS duration injection.
Replace the standalone `action_queue` parameter with `settings: OverkizClientSettings | None` to consolidate all behavioral configuration into a single entry point. This is a v2 breaking change.
Add _apply_rts_duration method that inspects each action's device URL protocol and appends rts_command_duration to RTS commands whose CommandDefinition.nparams allows an extra parameter. Original actions are never mutated. This replaces the hardcoded COMMANDS_WITHOUT_DELAY exclusion list previously needed in Home Assistant.
Contributor
There was a problem hiding this comment.
Pull request overview
This PR introduces a structured OverkizClientSettings object to centralize behavioral configuration for OverkizClient, and adds RTS-specific command-parameter injection logic when executing action groups.
Changes:
- Add
OverkizClientSettings(action queue settings + RTS command duration). - Add RTS duration parameter injection in
OverkizClient.execute_action_group()for RTS devices. - Add
Device.get_command_definition()helper and expand test coverage for the new behaviors.
Reviewed changes
Copilot reviewed 8 out of 8 changed files in this pull request and generated 3 comments.
Show a summary per file
| File | Description |
|---|---|
pyoverkiz/client_settings.py |
Introduces the new settings dataclass for client behavior. |
pyoverkiz/client.py |
Switches constructor to settings=... and injects RTS duration in execute_action_group(). |
pyoverkiz/models.py |
Adds Device.get_command_definition() used by injection logic. |
tests/test_rts_injection.py |
New tests covering RTS duration injection behavior and mutation safety. |
tests/test_models.py |
Adds tests for Device.get_command_definition(). |
tests/test_client_settings.py |
New unit tests for OverkizClientSettings defaults/fields. |
tests/test_client_queue_integration.py |
Updates queue integration tests to use settings=OverkizClientSettings(...). |
tests/test_client.py |
Adds integration assertions for settings -> client internal fields. |
💡 Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
No description provided.