Skip to content

Support Light with Motion Sensor #2279

New issue

Have a question about this project? # for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “#”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? # to your account

Merged
merged 1 commit into from
Jul 22, 2025

Conversation

nickolas-deboom
Copy link
Contributor

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

This change adds a generic fingerprint and supporting profile for a light with a motion sensor.

Summary of Completed Tests

New test case added.

Copy link

Duplicate profile check: Passed - no duplicate profiles detected.

Copy link

github-actions bot commented Jul 22, 2025

Channel deleted.

Copy link

github-actions bot commented Jul 22, 2025

Test Results

   68 files  ±0    446 suites  ±0   0s ⏱️ ±0s
2 324 tests +1  2 324 ✅ +1  0 💤 ±0  0 ❌ ±0 
3 919 runs  +1  3 919 ✅ +1  0 💤 ±0  0 ❌ ±0 

Results for commit a9ac2d0. ± Comparison against base commit 570fe54.

This pull request removes 3 and adds 4 tests. Note that renamed tests count towards both.
Test profile change on init for mounted dimmable load control parent cluster as server
Test profile change on init for mounted onoff control parent cluster as server
Test profile change on init for onoff parent cluster as client
Test init for light with motion sensor
Test init for mounted dimmable load control parent cluster as server
Test init for mounted onoff control parent cluster as server
Test init for onoff parent cluster as client

♻️ This comment has been updated with latest results.

Copy link

github-actions bot commented Jul 22, 2025

File Coverage
All files 92%
/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 93%
/home/runner/work/SmartThingsEdgeDrivers/SmartThingsEdgeDrivers/drivers/SmartThings/matter-switch/src/embedded-cluster-utils.lua 38%
/home/runner/work/SmartThingsEdgeDrivers/SmartThingsEdgeDrivers/drivers/SmartThings/matter-switch/src/eve-energy/init.lua 92%
/home/runner/work/SmartThingsEdgeDrivers/SmartThingsEdgeDrivers/drivers/SmartThings/matter-switch/src/third-reality-mk1/init.lua 95%

Minimum allowed coverage is 90%

Generated by 🐒 cobertura-action against 3e40cf6

@hcarter-775
Copy link
Contributor

as we do with the fan+light device, I believe we should add this to our match_profile logic. Changes coming soon will require this anyway, so I believe it would be best to implement it now

@nickolas-deboom
Copy link
Contributor Author

as we do with the fan+light device, I believe we should add this to our match_profile logic. Changes coming soon will require this anyway, so I believe it would be best to implement it now

Sure, that works too. I guess we can remove the fingerprint then. We also don't need the fingerprint for the fan light I suppose

@nickolas-deboom
Copy link
Contributor Author

nickolas-deboom commented Jul 22, 2025

Looking at it again, I think we should go with the fingerprint approach until modular profiles are implemented. There are other devices that use profiles with the motionSensor capability that rely on fingerprints that would be messed with if we re-profile based on the presense of the OccupancySensing cluster.

@hcarter-775
Copy link
Contributor

yeah, I can update the logic in this PR, which is where I see issues coming up

@nickolas-deboom
Copy link
Contributor Author

I added one more commit to use a range of 1-100 for switchLevel in the profile as we do for other dimmer light profiles.

This change adds a generic fingerprint and supporting profile for a
light with a motion sensor.
@nickolas-deboom nickolas-deboom force-pushed the support-light-with-motion-sensor branch from a9ac2d0 to 3e40cf6 Compare July 22, 2025 19:24
@nickolas-deboom nickolas-deboom merged commit a961e67 into main Jul 22, 2025
9 of 10 checks passed
@nickolas-deboom nickolas-deboom deleted the support-light-with-motion-sensor branch July 22, 2025 19:25
# for free to join this conversation on GitHub. Already have an account? # to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants