-
-
Notifications
You must be signed in to change notification settings - Fork 562
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
Introduce common interfaces based on device descriptors #1845
Merged
Conversation
This file contains 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
This completes the common descriptor-based API for all device-inherited classes: - status() -> DeviceStatus: returns device status - descriptors() -> DescriptorCollection[Descriptor]: returns all defined descriptors - actions() -> DescriptorCollection[ActionDescriptor]: returns all defined actions - settings() -> DescriptorCollection[PropertyDescriptor]: returns all settable descriptors - sensors() -> DescriptorCollection[PropertyDescriptor]: returns all read-only descriptors - call_action(name, params): to call action using its name - change_setting(name, params): to change a setting using its name These functionalities are also provided as cli commands for all devices: - status - descriptors - actions - settings - sensors - call (call_action) - set (change_setting)
Codecov Report
@@ Coverage Diff @@
## master #1845 +/- ##
==========================================
+ Coverage 80.87% 81.20% +0.32%
==========================================
Files 193 193
Lines 18599 18587 -12
Branches 4021 4022 +1
==========================================
+ Hits 15042 15093 +51
+ Misses 3279 3219 -60
+ Partials 278 275 -3
📣 We’re building smart automated test selection to slash your CI/CD build times. Learn more |
rytilahti
force-pushed
the
refactor/descriptorcollection
branch
from
October 20, 2023 18:31
b20fef6
to
ae602a9
Compare
The docstrings shall do fine for now so I'll just merge this to allow people test it, proper docs for library usage can be added in a separate PR. |
rytilahti
added a commit
that referenced
this pull request
Oct 21, 2023
This is not needed anymore, as #1845 reports on missing identifiers and roborocks are covered by a wildcard matcher in devicefactory
rytilahti
added a commit
that referenced
this pull request
Oct 23, 2023
Fixes regression caused by introduction of the common device API (#1845)
rytilahti
added a commit
that referenced
this pull request
Oct 23, 2023
This is not needed anymore, as #1845 reports on missing identifiers and roborocks are covered by a wildcard matcher in devicefactory. The original reason for adding this warning was to gather a list of devices that we should add to the supported devices list for devicefactory, but I think we are well covered now at least for roborock (closing the issues below, other integrations need to be adapted to use wildcards where feasible).
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 change:
MiotDevice.call_action
has been renamed toMiotDevice.call_action_from_mapping
.This completes the common descriptor-based API for all device-inherited classes:
These functionalities are also provided as cli commands for all devices:
TODO:
Fixes #1814
Fixes #1692