Skip to content

Matter Sensor: Add modular profile supports for AQS #2082

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

Open
wants to merge 1 commit into
base: main
Choose a base branch
from

Conversation

ctowns
Copy link
Contributor

@ctowns ctowns commented Apr 18, 2025

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

Summary of Completed Tests

Copy link

Duplicate profile check: Passed - no duplicate profiles detected.

Copy link

Copy link

github-actions bot commented Apr 18, 2025

Test Results

   66 files    423 suites   0s ⏱️
2 175 tests 2 171 ✅ 0 💤 4 ❌
3 700 runs  3 695 ✅ 0 💤 5 ❌

For more details on these failures, see this check.

Results for commit 91e95e5.

♻️ This comment has been updated with latest results.

Copy link

github-actions bot commented Apr 18, 2025

File Coverage
All files 81%
/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/smoke-co-alarm/init.lua 84%
/home/runner/work/SmartThingsEdgeDrivers/SmartThingsEdgeDrivers/drivers/SmartThings/matter-sensor/src/init.lua 91%
/home/runner/work/SmartThingsEdgeDrivers/SmartThingsEdgeDrivers/drivers/SmartThings/matter-sensor/src/bosch-button-contact/init.lua 44%
/home/runner/work/SmartThingsEdgeDrivers/SmartThingsEdgeDrivers/drivers/SmartThings/matter-sensor/src/air-quality-sensor/init.lua 82%

Minimum allowed coverage is 90%

Generated by 🐒 cobertura-action against 91e95e5

@ctowns ctowns force-pushed the modular-profiles-matter-sensor branch 2 times, most recently from 271a839 to 83f4407 Compare April 18, 2025 17:20

table.insert(optional_supported_component_capabilities, {"main", main_component_capabilities})

device:set_field(SUPPORTED_COMPONENT_CAPABILITIES, optional_supported_component_capabilities)
Copy link
Contributor

Choose a reason for hiding this comment

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

this line does not seem required, since the field is overwritten two lines later


-- add mandatory capabilities for subscription
local total_supported_capabilities = optional_supported_component_capabilities
table.insert(total_supported_capabilities[1][2], capabilities.airQualityHealthConcern.ID)
Copy link
Contributor

@hcarter-775 hcarter-775 Apr 18, 2025

Choose a reason for hiding this comment

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

nit, though I think inserting into "[1][2]" is a little confusing and asks the reader to trace back what [1][2] actually references.


device:set_field(SUPPORTED_COMPONENT_CAPABILITIES, total_supported_capabilities, { persist = true })

--re-up subscription with new capabiltiies using the moudlar supports_capability override
Copy link
Contributor

Choose a reason for hiding this comment

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

Suggested change
--re-up subscription with new capabiltiies using the moudlar supports_capability override
--re-up subscription with new capabilities using the modular supports_capability override

@@ -271,6 +293,81 @@ local function do_configure(driver, device)
device:try_update_metadata({profile = profile_name})
end

local function supports_capability_by_id_modular(device, capability, component)
Copy link
Contributor

Choose a reason for hiding this comment

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

nit: do we need the _modular at the end of this function? Does its name need to be distinct from the scripting engine function it's overwriting?


local function do_configure(driver, device)
-- must use profile switching on older hubs
if version.api < 14 and version.rpc < 7 then
Copy link
Contributor

Choose a reason for hiding this comment

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

Was the RPC version bumped for 0.57?

@ctowns ctowns force-pushed the modular-profiles-matter-sensor branch from 83f4407 to 91e95e5 Compare April 18, 2025 22:19
# 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.

3 participants