Matter Camera: Prevent duplicate zones in triggeredZones report#3008
Open
ctowns wants to merge 1 commit into
Open
Matter Camera: Prevent duplicate zones in triggeredZones report#3008ctowns wants to merge 1 commit into
ctowns wants to merge 1 commit into
Conversation
|
Invitation URL: |
b7b4586 to
2f28b5a
Compare
|
Minimum allowed coverage is Generated by 🐒 cobertura-action against 2f28b5a |
Test Results 73 files 515 suites 0s ⏱️ Results for commit 2f28b5a. |
hcarter-775
approved these changes
May 29, 2026
|
|
||
| function CameraEventHandlers.zone_triggered_handler(driver, device, ib, response) | ||
| local triggered_zones = device:get_field(camera_fields.TRIGGERED_ZONES) or {} | ||
| if not switch_utils.tbl_contains(triggered_zones, ib.data.elements.zone.value) then |
Contributor
There was a problem hiding this comment.
nit but could be cool. Maybe leave the generic tbl_contains but expand that fn to optionally take a key to compare.
like
function tbl_contains(array, element, match_key)
where in this case match_key would be zoneId.
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Check all that apply
Type of Change
Checklist
Description of Change
Prevents duplicate zones from being added to the
triggeredZonesattribute of thezoneManagementcapability.Summary of Completed Tests