-
Notifications
You must be signed in to change notification settings - Fork 476
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
Add batteryLevel to matter switch #1862
Conversation
Duplicate profile check: Passed - no duplicate profiles detected. |
Test Results 64 files 409 suites 0s ⏱️ Results for commit 8b4c907. ♻️ This comment has been updated with latest results. |
Minimum allowed coverage is Generated by 🐒 cobertura-action against 8b4c907 |
Channel deleted. |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
LGTM!
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Actually I jumped the gun. Before merging, there is some maybe messy conflict with the recent Aqara climate device PR. This should be handled and discussed if necessary before merging.
Improve the profile selection logic in matter-switch by reading the AttributeList, checking if BatPercentRemaining or BatChargeLevel is available, and then profile the device as needed.
9483876
to
cd45c95
Compare
Type of Change
Checklist
Description of Change
CHAD-12161
Matter drivers currently assume that
BatPercentRemaining
is available if theBAT
feature is supported, but this attribute is only optionally required if this feature is present. The changes in this PR improve the profile selection logic in matter-switch by reading theAttributeList
, checking ifBatPercentRemaining
orBatChargeLevel
is available, and then profiling the device as needed.Note that these changes were originally in PR 1796 but this PR was split up into 5 separate PRs, one for each affected driver.
Summary of Completed Tests
Tested with a matter button, which supports
BatPercentRemaining
. Relevant logs:The device was profiled to
7-button-battery
(the profile it was already joined to).