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

Add Aqara Light Switch H2 #1822

Merged
merged 6 commits into from
Jan 22, 2025
Merged

Conversation

DongHoon-Ryu
Copy link
Contributor

This is a new Matter Device with four physical switches.

  • Two of each of the four switchs have On/Off Light(0x0100) and Generic Switch(0x000F) device types.
  • The other two switches have a Generic Switch(0x000F) device type.
  • The root node has Electrical Sensor(0x0510) utility device type.

Check all that apply

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

Checklist

  • I have performed a self-review of my code
  • I have commented my code in hard-to-understand areas
  • 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

Add new device profile and sub-driver

Summary of Completed Tests

  • Successful test for Plugin UI update and Dashboard's Device Card status update according to the switch operations

Copy link

Duplicate profile check: Passed - no duplicate profiles detected.

Copy link

github-actions bot commented Dec 12, 2024

Channel deleted.

Copy link

github-actions bot commented Dec 12, 2024

Test Results

   64 files  ±0    405 suites  +1   0s ⏱️ ±0s
2 011 tests +2  2 011 ✅ +2  0 💤 ±0  0 ❌ ±0 
3 473 runs  +2  3 473 ✅ +2  0 💤 ±0  0 ❌ ±0 

Results for commit 74916a3. ± Comparison against base commit ad6cc1c.

♻️ This comment has been updated with latest results.

Copy link

github-actions bot commented Dec 12, 2024

File Coverage
All files 94%
/home/runner/work/SmartThingsEdgeDrivers/SmartThingsEdgeDrivers/drivers/SmartThings/matter-switch/src/aqara-cube/init.lua 96%
/home/runner/work/SmartThingsEdgeDrivers/SmartThingsEdgeDrivers/drivers/SmartThings/matter-switch/src/init.lua 97%
/home/runner/work/SmartThingsEdgeDrivers/SmartThingsEdgeDrivers/drivers/SmartThings/matter-switch/src/eve-energy/init.lua 91%
/home/runner/work/SmartThingsEdgeDrivers/SmartThingsEdgeDrivers/drivers/SmartThings/matter-switch/src/embedded-cluster-utils.lua 38%

Minimum allowed coverage is 90%

Generated by 🐒 cobertura-action against 74916a3

@DongHoon-Ryu DongHoon-Ryu force-pushed the main branch 2 times, most recently from c05f491 to cddce78 Compare December 12, 2024 13:45
@DongHoon-Ryu DongHoon-Ryu force-pushed the main branch 4 times, most recently from a21c2f2 to b07b833 Compare December 13, 2024 13:17
@lelandblue lelandblue requested a review from tpmanley December 16, 2024 15:29
@nickolas-deboom
Copy link
Contributor

nickolas-deboom commented Dec 16, 2024

Hi @DongHoon-Ryu these changes look good to me with one comment that I left. I was also wondering if you could create a few test cases to show that this device would join the expected profile and the child devices are created as expected?

@nickolas-deboom
Copy link
Contributor

Also, there appears to be a luacheck issue as well as an issue with an existing test case

@DongHoon-Ryu
Copy link
Contributor Author

DongHoon-Ryu commented Dec 17, 2024

Hi @DongHoon-Ryu these changes look good to me with one comment that I left. I was also wondering if you could create a few test cases to show that this device would join the expected profile and the child devices are created as expected?

Thanks, I will add test cases by tomorrow. ==> I added a new test case file.

Also, there appears to be a luacheck issue as well as an issue with an existing test case

I resolved it.

Copy link

github-actions bot commented Dec 19, 2024

Channel deleted.

@DongHoon-Ryu DongHoon-Ryu force-pushed the main branch 4 times, most recently from 74d2090 to 57b46bf Compare December 20, 2024 06:56
@nickolas-deboom
Copy link
Contributor

Pending resolutions to the other comments that Harrison left, these changes look good to me!

@lelandblue lelandblue added the WWST label Jan 9, 2025
@nickolas-deboom
Copy link
Contributor

One thing I forgot to mention - would it be better to have everything in the same profile? It's been brought up before that for these light devices that also contain buttons that the best user experience is to have the light(s) be considered the 'main' device rather than the buttons. We did something similar for a GE/Cync device that contained multiple light endpoints and multiple button endpoints (see here).

@DongHoon-Ryu
Copy link
Contributor Author

One thing I forgot to mention - would it be better to have everything in the same profile? It's been brought up before that for these light devices that also contain buttons that the best user experience is to have the light(s) be considered the 'main' device rather than the buttons. We did something similar for a GE/Cync device that contained multiple light endpoints and multiple button endpoints (see here).

When I asked some of my colleagues, there were many opinions that the UI I implemented now is good. However, when there is power management at the root endpoint as it is now, it would be better to consider implementing it as a plugin because there are many difficulties while handling related capabilities on the EDGE_CHILD device rather than the main endpoint. I will update the results again tomorrow regarding this.

This is a new Matter Device with four physical switches.
 - Two of each of the four switchs have On/Off Light(0x0100) and Generic Switch(0x000F) device types.
 - The other two switches have a Generic Switch(0x000F) device type.
 - The root node has Electrical Sensor(0x0510) utility device type.
@DongHoon-Ryu
Copy link
Contributor Author

One thing I forgot to mention - would it be better to have everything in the same profile? It's been brought up before that for these light devices that also contain buttons that the best user experience is to have the light(s) be considered the 'main' device rather than the buttons. We did something similar for a GE/Cync device that contained multiple light endpoints and multiple button endpoints (see here).

When I asked some of my colleagues, there were many opinions that the UI I implemented now is good. However, when there is power management at the root endpoint as it is now, it would be better to consider implementing it as a plugin because there are many difficulties while handling related capabilities on the EDGE_CHILD device rather than the main endpoint. I will update the results again tomorrow regarding this.

@nickolas-deboom I have implemented ep1 as MCD as main_endpoint like GE / Sync device, but the same problem still exists when energy management is in ep0. First of all, it would be better to merge with main branch with the current implementation. Please review it.

@hcarter-775
Copy link
Contributor

hcarter-775 commented Jan 17, 2025

@DongHoon-Ryu This looks very good, and I am almost ready to approve it. Last thing though, the matter-switch driver is a very important driver, so would you mind onboarding a couple devices for some regression testing to make sure the flow hasn't been changed? This would need to include 1 or 2 button-switch devices, and 1 or 2 multi-switch devices.

@DongHoon-Ryu
Copy link
Contributor Author

@DongHoon-Ryu This looks very good, and I am almost ready to approve it. Last thing though, the matter-switch driver is a very important driver, so would you mind onboarding a couple devices for some regression testing to make sure the flow hasn't been changed? This would need to include 1 or 2 button-switch devices, and 1 or 2 multi-switch devices.

@hcarter-775 Yes, I did a regression test including the type of devices you mentioned, and there was no problem. Please approve.

@HunsupJung HunsupJung merged commit a8aa597 into SmartThingsCommunity:main Jan 22, 2025
12 checks passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Projects
None yet
Development

Successfully merging this pull request may close these issues.

5 participants