-
Notifications
You must be signed in to change notification settings - Fork 484
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
base: main
Are you sure you want to change the base?
Conversation
Duplicate profile check: Passed - no duplicate profiles detected. |
Invitation URL: |
Test Results 66 files 423 suites 0s ⏱️ For more details on these failures, see this check. Results for commit 91e95e5. ♻️ This comment has been updated with latest results. |
Minimum allowed coverage is Generated by 🐒 cobertura-action against 91e95e5 |
271a839
to
83f4407
Compare
|
||
table.insert(optional_supported_component_capabilities, {"main", main_component_capabilities}) | ||
|
||
device:set_field(SUPPORTED_COMPONENT_CAPABILITIES, optional_supported_component_capabilities) |
There was a problem hiding this comment.
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) |
There was a problem hiding this comment.
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 |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
--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) |
There was a problem hiding this comment.
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 |
There was a problem hiding this comment.
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?
83f4407
to
91e95e5
Compare
Check all that apply
Type of Change
Checklist
Description of Change
Summary of Completed Tests