Skip to content
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

Matter cover position improvements #92278

Conversation

Diegorro98
Copy link
Contributor

@Diegorro98 Diegorro98 commented Apr 30, 2023

⚠️ 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 CurrentPositionLiftPercentage and CurrentPositionTiltPercentage to CurrentPositionLiftPercent100ths and CurrentPositionTiltPercent100ths
    • 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.
  • Updated tests and added more tests

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)
  • 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

  • The code change is tested and works locally.
  • Local tests pass. Your PR cannot be merged unless tests pass
  • There is no commented out code in this PR.
  • I have followed the development checklist
  • I have followed the perfect PR recommendations
  • The code has been formatted using Black (black --fast homeassistant tests)
  • Tests have been added to verify that the new code works.

If user exposed functionality or configuration variables are added/changed:

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 running python3 -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:

@home-assistant
Copy link

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 close Closes the pull request.
  • @home-assistant rename Awesome new title Renames the pull request.
  • @home-assistant reopen Reopen the pull request.
  • @home-assistant unassign matter Removes the current integration label and assignees on the pull request, add the integration domain after the command.

@Diegorro98 Diegorro98 mentioned this pull request Apr 30, 2023
20 tasks
@Diegorro98
Copy link
Contributor Author

This PR should wait for the first PR to be merged to be rebased over that merge

@Diegorro98 Diegorro98 force-pushed the matter_cover_position_improvements branch from ba45f60 to ed97e32 Compare May 22, 2023 17:28
@Diegorro98 Diegorro98 marked this pull request as draft May 22, 2023 17:42
@Diegorro98 Diegorro98 force-pushed the matter_cover_position_improvements branch 2 times, most recently from 7c67ce2 to 0e6e195 Compare May 26, 2023 16:00
@Diegorro98 Diegorro98 force-pushed the matter_cover_position_improvements branch from 91ba9dd to 33581da Compare May 30, 2023 11:21
@Diegorro98 Diegorro98 marked this pull request as ready for review May 30, 2023 11:25
Copy link
Member

@MartinHjelmare MartinHjelmare left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Looks good!

@marcelveldt?

Copy link
Member

@marcelveldt marcelveldt left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

nice!

Copy link
Member

@marcelveldt marcelveldt left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

nice!

@MartinHjelmare MartinHjelmare merged commit 3cf8ae6 into home-assistant:dev May 31, 2023
24 checks passed
@Diegorro98
Copy link
Contributor Author

Thank you guys! So glad I could contribute to Home Assistant 😊!

@Diegorro98 Diegorro98 deleted the matter_cover_position_improvements branch May 31, 2023 14:29
@marcelveldt
Copy link
Member

Thank you guys! So glad I could contribute to Home Assistant 😊!

No, thank you for your contribution, that is really appreciated!

@github-actions github-actions bot locked and limited conversation to collaborators Jun 1, 2023
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Projects
None yet
Development

Successfully merging this pull request may close these issues.

None yet

3 participants