-
Notifications
You must be signed in to change notification settings - Fork 523
Matter Switch: Improve battery profiling #2724
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
base: main
Are you sure you want to change the base?
Conversation
This implements a few changes to the way that devices supporting batteries are profiled: * subscribe to PowerSource.AttributeList rather than reading this attribute, to help prevent failed reads from causing issues with device profiling * update the profile within match_profile rather than power_source_attribute_list_handler * use existing structure for handling waiting for profiling data before attempting a profile update
|
Invitation URL: |
Test Results 71 files 482 suites 0s ⏱️ Results for commit b0ab7ba. ♻️ This comment has been updated with latest results. |
|
Minimum allowed coverage is Generated by 🐒 cobertura-action against b0ab7ba |
| end | ||
| if switch_utils.get_product_override_field(device, "is_climate_sensor_w100") then | ||
| profile_name = "3-button-battery-temperature-humidity" | ||
| end |
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.
It turns out that this is the only unique handling needed for this device (plus the existing logic in find_default_endpoint), so I was able to remove the extra block in power_source_attribute_list_handler
drivers/SmartThings/matter-switch/src/switch_handlers/attribute_handlers.lua
Outdated
Show resolved
Hide resolved
drivers/SmartThings/matter-switch/src/switch_handlers/attribute_handlers.lua
Outdated
Show resolved
Hide resolved
drivers/SmartThings/matter-switch/src/switch_handlers/attribute_handlers.lua
Outdated
Show resolved
Hide resolved
drivers/SmartThings/matter-switch/src/switch_utils/device_configuration.lua
Outdated
Show resolved
Hide resolved
drivers/SmartThings/matter-switch/src/switch_utils/device_configuration.lua
Outdated
Show resolved
Hide resolved
drivers/SmartThings/matter-switch/src/switch_handlers/attribute_handlers.lua
Outdated
Show resolved
Hide resolved
48c5b71 to
ac6e8e6
Compare
drivers/SmartThings/matter-switch/src/test/test_matter_multi_button.lua
Outdated
Show resolved
Hide resolved
155c0be to
b0ab7ba
Compare
This implements a few changes to the way that devices supporting batteries are profiled:
PowerSource.AttributeListrather than reading this attribute, to help prevent failed reads from causing issues with device profilingmatch_profilerather thanpower_source_attribute_list_handler