Skip to content

[1.5 backport] OccupancySensing: report HoldTime on legacy *OccupiedToUnoccupiedDelay aliases#71816

Open
j-ororke wants to merge 2 commits intoproject-chip:v1.5-branchfrom
j-ororke:backport_v1.5-2_subscription-report-fix-OccupancySensing
Open

[1.5 backport] OccupancySensing: report HoldTime on legacy *OccupiedToUnoccupiedDelay aliases#71816
j-ororke wants to merge 2 commits intoproject-chip:v1.5-branchfrom
j-ororke:backport_v1.5-2_subscription-report-fix-OccupancySensing

Conversation

@j-ororke
Copy link
Copy Markdown
Contributor

Summary

Backport of the alternative, ember/codegen-based fix (see #71370): when HoldTime changes, report the change not only for HoldTime but for each deprecated *OccupiedToUnoccupiedDelay attribute that is present on the endpoint, so clients subscribed to those legacy attribute IDs also receive a report. Those attributes alias the same value as HoldTime.

Related issues

Tracked by: matter-test-scripts#766
Upstream / reference: #71370

Testing

Build verification (compile the occupancy sensor server in the all-clusters test app without issues):

scripts/run_in_build_env.sh "./scripts/build/build_examples.py --target linux-x64-all-clusters-clang-test gen"
ninja -C out/linux-x64-all-clusters-clang-test obj/third_party/connectedhomeip/src/app/clusters/occupancy-sensor-server/all-clusters-common.occupancy-sensor-server.cpp.o

Ran OCC_2_3 test to cover this change:

scripts/tests/run_python_test.py --factory-reset --app out/linux-x64-all-clusters/chip-all-clusters-app --app-args "--discriminator 1234 --passcode 20202021 --KVS kvs1" --script-args "--storage-path admin_storage.json --discriminator 1234 --passcode 20202021 --PICS src/app/tests/suites/certification/ci-pics-values --endpoint 1 --commissioning-method on-network --bool-arg simulate_occupancy:true" --script src/python_testing/TC_OCC_2_3.py

No issues with running the test with the code changes made, in which this issue was found initially.

@j-ororke j-ororke self-assigned this Apr 27, 2026
@github-actions github-actions Bot added the app label Apr 27, 2026
Copy link
Copy Markdown
Contributor

@gemini-code-assist gemini-code-assist Bot left a comment

Choose a reason for hiding this comment

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

Code Review

This pull request updates the occupancy sensor server to ensure that changes to the HoldTime attribute are correctly propagated to its deprecated aliases: PIROccupiedToUnoccupiedDelay, UltrasonicOccupiedToUnoccupiedDelay, and PhysicalContactOccupiedToUnoccupiedDelay. The implementation includes a check for the presence of these attributes on the endpoint before triggering the reporting callback. Feedback was provided regarding a redundant line in the source code comments that should be removed to improve readability.

Comment thread src/app/clusters/occupancy-sensor-server/occupancy-sensor-server.cpp Outdated
@j-ororke j-ororke requested review from andy31415 April 27, 2026 23:02
@j-ororke j-ororke marked this pull request as ready for review April 28, 2026 01:34
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant