Skip to content

Update co device profile to support battery capability #1977

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

Open
wants to merge 1 commit into
base: main
Choose a base branch
from
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
16 changes: 16 additions & 0 deletions drivers/SmartThings/matter-sensor/profiles/co-battery-fault.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,16 @@
name: co-battery-fault
components:
- id: main
capabilities:
- id: carbonMonoxideDetector
version: 1
- id: battery
version: 1
- id: hardwareFault
version: 1
- id: firmwareUpdate
version: 1
- id: refresh
version: 1
categories:
- name: SmokeDetector
8 changes: 8 additions & 0 deletions drivers/SmartThings/matter-sensor/src/init.lua
Original file line number Diff line number Diff line change
Expand Up @@ -149,6 +149,14 @@ local function match_profile(driver, device, battery_supported)
if device:supports_capability(capabilities.waterSensor) then
profile_name = profile_name .. "-leak"
end

if device:supports_capability(capabilities.smokeDetector) then
profile_name = profile_name .. "-smoke"
end

if device:supports_capability(capabilities.carbonMonoxideDetector) then
profile_name = profile_name .. "-co"
end

if battery_supported == battery_support.BATTERY_PERCENTAGE then
profile_name = profile_name .. "-battery"
Expand Down