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

Update smoke co alarm fault support #2045

Open
wants to merge 8 commits into
base: main
Choose a base branch
from

Conversation

hcarter-775
Copy link
Contributor

Description of Change

Support the SmokeCOAlarm attribute BatteryAlert through the hardwareFault capability. Support the batteryLevel capability with the PowerSource attribute BatChargeLevel, and include battery capability support with the PowerSource attribute BatPercentRemaining.

Summary of Completed Tests

nickolas-deboom and others added 7 commits April 2, 2025 14:50
This change adds support for the battery percentage for devices that
support the BatPercentRemaining attribute from the PowerSource cluster
in addition to the battery level from the SmokeCoAlarm cluster.
Use battery if supported by the device, otherwise use batteryLevel if
the percentage is not supported.
Copy link

github-actions bot commented Apr 2, 2025

Duplicate profile check: Passed - no duplicate profiles detected.

Copy link

github-actions bot commented Apr 2, 2025

Test Results

   66 files    421 suites   0s ⏱️
2 153 tests 2 142 ✅ 0 💤 11 ❌
3 676 runs  3 665 ✅ 0 💤 11 ❌

For more details on these failures, see this check.

Results for commit d334cd0.

♻️ This comment has been updated with latest results.

Copy link

github-actions bot commented Apr 2, 2025

File Coverage
All files 80%
/home/runner/work/SmartThingsEdgeDrivers/SmartThingsEdgeDrivers/drivers/SmartThings/matter-sensor/src/air-quality-sensor/init.lua 92%
/home/runner/work/SmartThingsEdgeDrivers/SmartThingsEdgeDrivers/drivers/SmartThings/matter-sensor/src/smoke-co-alarm/init.lua 46%
/home/runner/work/SmartThingsEdgeDrivers/SmartThingsEdgeDrivers/drivers/SmartThings/matter-sensor/src/embedded-cluster-utils.lua 45%
/home/runner/work/SmartThingsEdgeDrivers/SmartThingsEdgeDrivers/drivers/SmartThings/matter-sensor/src/init.lua 91%

Minimum allowed coverage is 90%

Generated by 🐒 cobertura-action against d334cd0

Copy link

github-actions bot commented Apr 2, 2025

@@ -81,7 +83,6 @@ local function test_init()
end
test.socket.matter:__expect_send({mock_device.id, subscribe_request})
test.mock_device.add_test_device(mock_device)
mock_device:expect_metadata_update({ profile = "smoke-co-temp-humidity-comeas" })
end

Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Could you add UT(s) that test the hardwareFault capability being set by BatteryAlert?

if #battery_feature_eps > 0 then
device:send(clusters.PowerSource.attributes.AttributeList:read())
else
match_profile(device, battery_support.NO_BATTERY)
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Should we create profiles that exclude the battery capabilities? The way it is now, there will be no change in behavior if the battery feature is not supported, but that would mean that the batteryLevel capability would still be included in the profile (and would show up as blank), which isn't a huge deal but we could just create some -nobattery profiles

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants