Matter cover position improvements
⚠️ This PR is the second part of a set of changes, first part: #92256 ⚠️ This would be the comparation between first and second pr: diff
Proposed change
- Position will be updated only if the endpoint has the position attributes
- Changed the attribute in which is based the position from
CurrentPositionLiftPercentageandCurrentPositionTiltPercentagetoCurrentPositionLiftPercent100thsandCurrentPositionTiltPercent100ths- This change has been done because at the matter specs, the old ones are optional and the new ones are mandatory.
- Position is rounded to the ceiling (in fact is rounded to the floor but then is subtracted to 100, so it is like is rounded to the ceiling) because 0.01% open is near to be closed, but it stills open.
- Added test and multiple fixtures that contains different features to test both PRs
Type of change
- [ ] Dependency upgrade
- [ ] Bugfix (non-breaking change which fixes an issue)
- [ ] New integration (thank you!)
- [ ] New feature (which adds functionality to an existing integration)
- [ ] Deprecation (breaking change to happen in the future)
- [ ] Breaking change (fix/feature causing existing functionality to break)
- [x] Code quality improvements to existing code or addition of tests
Additional information
- This PR does not fix or close any issue
- This PR is not related to issue
- There is no link to documentation pull request
Checklist
- [X] The code change is tested and works locally.
- [X] Local tests pass. Your PR cannot be merged unless tests pass
- [X] There is no commented out code in this PR.
- [X] I have followed the development checklist
- [X] I have followed the perfect PR recommendations
- [X] The code has been formatted using Black (
black --fast homeassistant tests) - [X] Tests have been added to verify that the new code works.
If user exposed functionality or configuration variables are added/changed:
- [ ] Documentation added/updated for www.home-assistant.io
If the code communicates with devices, web services, or third-party tools:
- [ ] The manifest file has all fields filled out correctly.
Updated and included derived files by running:python3 -m script.hassfest. - [ ] New or updated dependencies have been added to
requirements_all.txt.
Updated by runningpython3 -m script.gen_requirements_all. - [ ] For the updated dependencies - a link to the changelog, or at minimum a diff between library versions is added to the PR description.
- [ ] Untested files have been added to
.coveragerc.
To help with the load of incoming pull requests:
- [ ] I have reviewed two other open pull requests in this repository.
Hey there @home-assistant/matter, mind taking a look at this pull request as it has been labeled with an integration (matter) you are listed as a code owner for? Thanks!
Code owner commands
Code owners of matter can trigger bot actions by commenting:
@home-assistant closeCloses the pull request.@home-assistant rename Awesome new titleRenames the pull request.@home-assistant reopenReopen the pull request.@home-assistant unassign matterRemoves the current integration label and assignees on the pull request, add the integration domain after the command.
This PR should wait for the first PR to be merged to be rebased over that merge
Thank you guys! So glad I could contribute to Home Assistant 😊!
Thank you guys! So glad I could contribute to Home Assistant 😊!
No, thank you for your contribution, that is really appreciated!