-
Notifications
You must be signed in to change notification settings - Fork 34
2.0 #1872
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Draft
iMicknl
wants to merge
6
commits into
main
Choose a base branch
from
v2/main
base: main
Could not load branches
Branch not found: {{ refName }}
Loading
Could not load tags
Nothing to show
Loading
Are you sure you want to change the base?
Some commits from the old base branch may be removed from the timeline,
and old review comments may become outdated.
Conversation
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
* Bump minimum required Python version to 3.12 * Update CI/CD
…oup for Execution typing (#1864) * Rename scenario to action group * Rename test * Fix docstring formatting in ActionGroup class * Remove unnecessary assertions in ActionGroup initialization
…methods. (#1862) - `client.execute_command()` and `client.execute_commands()` are replaced by `client.execute_action_group()` - `client.execute_action_group()` now supports multiple execution modes (high priority, internal, geolocated) - `client.execute_action_group()` now supports multiple device actions in the same request The current execution methods are poorly typed and do not support concurrent execution across multiple devices, which makes it impossible to properly work around TooManyExecutionsException and TooManyConcurrentRequestsException. The main change is the move from `client.execute_command()` and `client.execute_commands()` to a single `client.execute_action_group()`. An action group takes a list of actions, each of which can include multiple device actions, including multiple commands per action. ```python3 await client.execute_action_group( actions=[ Action( device_url="io://1234-5678-1234/12345678", commands=[ Command(name="down"), Command(name="refresh") ] ) ], label="Execution via Home Assistant" ) ``` New (mode) options like high priority will be possible now: ```python3 await client.execute_action_group( actions=[ Action( device_url="io://1234-5678-1234/12345678", commands=[ Command(name=OverkizCommand.SET_CLOSURE, parameters=[0]) ] ) ], label="Execution via Home Assistant", mode=CommandMode.HIGH_PRIORITY ) ``` This could serve as a foundation for grouping commands that are executed within a short time window, for example when triggered by a scene or automation in Home Assistant. Requests issued close together could be batched and sent as a single action group, reducing the impact of current Overkiz limitations. The open question is where this queue should live: inside this integration itself, or as part of the Home Assistant core implementation. --------- Co-authored-by: Copilot <[email protected]>
…ial classes (#1867) - Introduced UsernamePasswordCredentials and LocalTokenCredentials for better credential management. - Updated OverkizClient to utilize the new credential classes and refactored login logic. - Added authentication strategies for various servers, including Somfy and Rexel. - Created new modules for auth strategies and credentials to improve code organization. - Enhanced README with updated usage examples for the new authentication methods. ## Breaking - `OverkizServer` class is renamed to `ServerConfig` and has additional `server` and `type` (cloud/local) property - `generate_local_server` is renamed to `create_local_server_config` - `client.api_type` is removed and now available via `ServerConfig` (e.g. `client.server_config.type`) - The `OverkizClient` constructor now requires passing a `ServerConfig` via `server` - The `OverkizClient` constructur now requires passing an `Credentials` class via `credentials`, e.g. `UsernamePasswordCredentials(USERNAME, PASSWORD)` for most server. ## Features - The OverkizClient constructor now supports passing a Server enum directly, such as `OverkizClient(server=Server.SOMFY_EUROPE, ...)`. --------- Co-authored-by: Copilot <[email protected]> Co-authored-by: iMicknl <[email protected]>
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.
Breaking changes
client.get_scenarios()is replaced byclient.get_action_groups()(Rename Scenario to ActionGroup (and relevant methods), reuse ActionGroup for Execution typing #1864)Scenario()model is replaced byActionGroup(), wherecreation_timeandmetadata` are now optional fields (Rename Scenario to ActionGroup (and relevant methods), reuse ActionGroup for Execution typing #1864)client.execute_command()andclient.execute_commands()are replaced byclient.execute_action_group()Addexecute_action_groupmethod and remove other command execution methods. #1862OverkizServerclass is renamed toServerConfigand has additionalserverandtype(cloud/local) property Refactor authentication handling in OverkizClient and add new credential classes #1867generate_local_serveris renamed tocreate_local_server_configRefactor authentication handling in OverkizClient and add new credential classes #1867client.api_typeis removed and now available viaServerConfig(e.g.client.server_config.type) Refactor authentication handling in OverkizClient and add new credential classes #1867OverkizClientconstructor now requires passing aServerConfigviaserverRefactor authentication handling in OverkizClient and add new credential classes #1867OverkizClientconstructur now requires passing anCredentialsclass viacredentials, e.g.UsernamePasswordCredentials(USERNAME, PASSWORD)for most server. Refactor authentication handling in OverkizClient and add new credential classes #1867Fixes
client.get_current_executions()is now properly typed, previously theExecution()model returned a list type foraction_group, what should be a dict type. (Rename Scenario to ActionGroup (and relevant methods), reuse ActionGroup for Execution typing #1864)Features
client.execute_action_group()now supports multiple execution modes (high priority, internal, geolocated) Addexecute_action_groupmethod and remove other command execution methods. #1862client.execute_action_group()now supports multiple device actions in the same request Addexecute_action_groupmethod and remove other command execution methods. #1862OverkizClient(server=Server.SOMFY_EUROPE, ...). Refactor authentication handling in OverkizClient and add new credential classes #1867