-
Notifications
You must be signed in to change notification settings - Fork 510
Support combination switch/button devices #1663
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
Support combination switch/button devices #1663
Conversation
This change adds support for devices containing both switch and button endpoints.
This change adds support for devices containing both switch and button endpoints.
…m:SmartThingsCommunity/SmartThingsEdgeDrivers into support-combination-switch-button-devices
2-button-battery-switch.yml was created during the initial work of this PR, when different configurations for combo button/switch devices were being tested, but should be removed now.
drivers/SmartThings/matter-switch/src/test_matter_button_switch_mcd.lua
Outdated
Show resolved
Hide resolved
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.
Just a reminder to rebase as well so that the latest changes are present and so that unit tests can run :)
* Sort endpoints before returning the default endpoint * Add comment on why the main endpoint should be a button endpoint if one exists
Channel deleted. |
Test Results 64 files 401 suites 0s ⏱️ Results for commit d14d457. ♻️ This comment has been updated with latest results. |
Minimum allowed coverage is Generated by 🐒 cobertura-action against d14d457 |
Done! |
* remove the component argument from find_default_endpoint * remove checks for button and switch endpoints in initialize_switch as they are not necessary
One thing we will want to do before merging these changes is complete a set of regression tests for the various device types that share this driver since we are touching a critical code path. I think you could potentially add the test cases to the great confluence page you already put together, listing which cases are covered by unit tests and real devices, or both: https://smartthings.atlassian.net/wiki/spaces/~7120201ec2fa4a1b0548dd86df78b89d08422e/pages/3449815291/Supporting+Combination+Button+Switch+Devices#Testing. Let's think of some device compositions that are commonly used and also add in some that might be corner cases. For example:
A good chunk of these are already covered by existing unit tests and the ones you have added, I just wanted to list all the ones I could think of to be complete. Where we can, we should do smoke testing with real devices in addition to the unit tests. Some of these will be impossible to test with real devices (test 8 for example, I'm not sure we have a real device like that), so they can be covered by a unit test case (which it looks like you've already done for test 8). If you can think of any more edge cases, please add them! |
Good point! I added section Test coverage for other device compositions to the confluence page. I created a table with the endpoint configurations you listed and linked to the test case files that cover each configuration. I tested out a few cases with physical devices I have, and I also expanded |
c5f1348
to
c5a9b6f
Compare
96e3191
to
926b8b4
Compare
I think this confluence page needs to be updated with the latest screenshots with the new component layout: Test coverage for other device compositions I would also note on that page what switch/button combos are supported, and what expected behavior is for an unsupported combination device. Also, I think another round of device regression testing might be good to verify the latest changes with the new layout. Fortunately, a lot of this is covered with unit tests, so good job on that test coverage! |
bdc0c0b
to
174d2da
Compare
174d2da
to
25cf9d3
Compare
I updated the confluence page with new details about testing, for both the Inovelli and the GE/Cync device. I added some notes on what the behavior would be for unsupported device types as well in the Testing section. |
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.
Few minor comments but otherwise looks good to me. Need to make sure to do a thorough regression test with devices that would use the affected code paths.
drivers/SmartThings/matter-switch/profiles/light-level-button.yml
Outdated
Show resolved
Hide resolved
I did regression testing on all of the devices listed on this page, which includes lights, plugs, and buttons as well as the GE/Cync and Inovelli switch/button combo devices. I also created unit tests to verify the functionality for a device that would join a MCD profile containing switch and button components as well as a device that has button endpoints and a switch endpoint that would not be supported by a MCD profile and uses parent-child for the switch endpoint instead. |
Type of Change
Checklist
Description of Change
CHAD-13993
This change adds support for devices that contain both switch and button endpoints. The button driver was initially merged into the driver in PR 1547, but until now only pure-button and pure-switch devices were supported.
The first switch endpoint and all button endpoints will join as a multi-component device, and additional switch endpoints will join as child devices.
The GE/Cync dimmer/keypad is an example of a device that is supported by this change.
Summary of Completed Tests
See new unit tests and also here for an overview of testing. Additional regression testing is documented here.