SmartThingsEdgeDrivers icon indicating copy to clipboard operation
SmartThingsEdgeDrivers copied to clipboard

Merge Switch and Button Drivers

Open nickolas-deboom opened this issue 1 year ago • 3 comments

Type of Change

  • [ ] WWST Certification Request
    • If this is your first time contributing code:
      • [ ] I have reviewed the README.md file
      • [ ] I have reviewed the CODE_OF_CONDUCT.md file
      • [ ] I have signed the CLA
    • [ ] I plan on entering a WWST Certification Request or have entered a request through the WWST Certification console at developer.smartthings.com
  • [ ] Bug fix
  • [ ] New feature
  • [X] Refactor

Checklist

  • [X] I have performed a self-review of my code
  • [X] I have commented my code in hard-to-understand areas
  • [X] I have verified my changes by testing with a device or have communicated a plan for testing
  • [ ] I am adding new behavior, such as adding a sub-driver, and have added and run new unit tests to cover the new behavior

Description of Change

This PR addresses CHAD-13270 to integrate the functionality from matter-button into the matter-switch driver, so that we can deprecate the matter-button driver.

Note that these changes were originally located in PR 1423, but that PR was split into multiple PRs in order to simplify the amount of changes. This PR only includes support for pure-button and pure-switch devices. Once more discussion has been had on how combination button-switch devices should be configured, PR 1423 will be updated to include support for these combination devices.

Testing was performed on several switch and button devices as documented here: https://smartthings.atlassian.net/wiki/spaces/CHIP/pages/3340304693/Matter-Switch+Matter-Button+Integration+Testing+Status

Summary of Completed Tests

nickolas-deboom avatar Jul 26 '24 16:07 nickolas-deboom

Duplicate profile check: Passed - no duplicate profiles detected.

github-actions[bot] avatar Jul 26 '24 16:07 github-actions[bot]

Test Results

   61 files    381 suites   0s :stopwatch: 1 855 tests 1 855 :white_check_mark: 0 :zzz: 0 :x: 3 241 runs  3 241 :white_check_mark: 0 :zzz: 0 :x:

Results for commit 0fbb9bc6.

:recycle: This comment has been updated with latest results.

github-actions[bot] avatar Jul 26 '24 16:07 github-actions[bot]

matter-button_coverage.xml

File Coverage
All files 92% :white_check_mark:
/home/runner/work/SmartThingsEdgeDrivers/SmartThingsEdgeDrivers/drivers/SmartThings/matter-button/src/init.lua 92% :white_check_mark:

matter-switch_coverage.xml

File Coverage
All files 96% :white_check_mark:
/home/runner/work/SmartThingsEdgeDrivers/SmartThingsEdgeDrivers/drivers/SmartThings/matter-button/src/init.lua 92% :white_check_mark:
/home/runner/work/SmartThingsEdgeDrivers/SmartThingsEdgeDrivers/drivers/SmartThings/matter-switch/src/init.lua 97% :white_check_mark:
/home/runner/work/SmartThingsEdgeDrivers/SmartThingsEdgeDrivers/drivers/SmartThings/matter-switch/src/eve-energy/init.lua 91% :white_check_mark:

Minimum allowed coverage is 90%

Generated by :monkey: cobertura-action against 0fbb9bc6083040f190468884939c0a4057747a8f

github-actions[bot] avatar Jul 26 '24 16:07 github-actions[bot]

Channel deleted.

github-actions[bot] avatar Aug 09 '24 15:08 github-actions[bot]

I left a few more small comments but this is my final review and I think it's ready. Has this also been regression tested with some of the switch/button devices on the VDA? For example, confirming a light, button, and composed bridged devices work would be a good test.

I tested several virtual switch devices as well as a composed bridge device with the VDA and everything is functioning as expected. The Generic Switch virtual device does not onboard properly so I tested the button functionality with an IKEA remote, which functioned as expected as well.

nickolas-deboom avatar Sep 05 '24 18:09 nickolas-deboom