Support the battery capability in smoke/co subdriver
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
- If this is your first time contributing code:
- [ ] Bug fix
- [x] New feature
- [ ] 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
- [x] 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 support for the battery capability for devices that support the BatPercentRemaining attribute from the PowerSource cluster. If the attribute is not supported, use batteryLevel if supported, otherwise use a profile without a battery capability.
Summary of Completed Tests
Tested with the VDA Smoke/CO Alarm device as well as new unit tests.
Duplicate profile check: Passed - no duplicate profiles detected.
Test Results
65 files + 1 419 suites +4 0s ⏱️ ±0s 2 122 tests +22 2 122 ✅ +22 0 💤 ±0 0 ❌ ±0 3 638 runs +46 3 638 ✅ +46 0 💤 ±0 0 ❌ ±0
Results for commit c596068a. ± Comparison against base commit 3dd1b23b.
:recycle: This comment has been updated with latest results.
| File | Coverage | |
|---|---|---|
| All files | 88% |
:x: |
| /home/runner/work/SmartThingsEdgeDrivers/SmartThingsEdgeDrivers/drivers/SmartThings/matter-sensor/src/init.lua | 91% |
:white_check_mark: |
| /home/runner/work/SmartThingsEdgeDrivers/SmartThingsEdgeDrivers/drivers/SmartThings/matter-sensor/src/air-quality-sensor/init.lua | 92% |
:white_check_mark: |
| /home/runner/work/SmartThingsEdgeDrivers/SmartThingsEdgeDrivers/drivers/SmartThings/matter-sensor/src/smoke-co-alarm/init.lua | 84% |
:x: |
| /home/runner/work/SmartThingsEdgeDrivers/SmartThingsEdgeDrivers/drivers/SmartThings/matter-sensor/src/embedded-cluster-utils.lua | 45% |
:x: |
Minimum allowed coverage is 90%
Generated by :monkey: cobertura-action against c596068a0cea6e44e6f1fcc3f1c5eff5a8a73ca6
Channel deleted.
I'm curious, how does the device card look with this? To me, it seems like it would look confusing to have two different battery capabilities displayed without context.
should we close this PR with the introduction of https://github.com/SmartThingsCommunity/SmartThingsEdgeDrivers/pull/2045
Closing in favor of #2045