-
-
Notifications
You must be signed in to change notification settings - Fork 36.7k
Matter Pir unoccupied to occupied delay #162435
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
base: dev
Are you sure you want to change the base?
Conversation
|
Hey there @home-assistant/matter, mind taking a look at this pull request as it has been labeled with an integration ( Code owner commandsCode owners of
|
Co-authored-by: Norbert Rittel <norbert@rittel.de>
…t inoccupé à occupé
…entries and standardize casing for threshold name
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.
Pull request overview
Adds support in the Matter integration for configuring PIR occupancy “unoccupied → occupied” timing/threshold attributes via number entities, with accompanying fixtures and test coverage.
Changes:
- Add Matter
numberentities forPIRUnoccupiedToOccupiedDelayandPIRUnoccupiedToOccupiedThreshold(gated by the PIR feature bit). - Add a new PIR occupancy sensor node fixture and extend snapshot coverage for the new fixture’s entities.
- Add explicit tests validating state updates and
write_attributecalls for the new numbers.
Reviewed changes
Copilot reviewed 8 out of 8 changed files in this pull request and generated 1 comment.
Show a summary per file
| File | Description |
|---|---|
homeassistant/components/matter/number.py |
Adds discovery schemas mapping the PIR delay/threshold attributes to number entities. |
homeassistant/components/matter/strings.json |
Adds translation keys for the two new number entity names. |
tests/components/matter/test_number.py |
Adds tests for the two new PIR occupancy sensing number entities (read/update/write). |
tests/components/matter/conftest.py |
Registers the new node fixture so it participates in parameterized Matter snapshot tests. |
tests/components/matter/fixtures/nodes/mock_occupancy_sensor_pir.json |
Adds a PIR occupancy sensing fixture exposing the new attributes for testing. |
tests/components/matter/snapshots/test_number.ambr |
Updates snapshots to include the two new number entities for the new fixture. |
tests/components/matter/snapshots/test_button.ambr |
Updates snapshots for entities produced by the new fixture (identify button). |
tests/components/matter/snapshots/test_binary_sensor.ambr |
Updates snapshots for entities produced by the new fixture (occupancy binary sensor). |
|
Do we have to stick to the convoluted naming from the Matter specs? Or could we use terms like
instead that are more in line with what Home Assistant uses otherwise? For the opposite direction the |
We can simplify if we find a simpler term for the user.
Good idea
Yes, in latest cluster revision, a new attribute has been introduced. |
|
You already answered while I further edited my above comment. 😃 As these will only show up in the Configuration section of occupancy sensors we could leave that word out and just go with
for those three related settings. As all three will have an entry field next to them, the shorter the label the better. |
…ection delay and threshold
I corrected the naming. |
NoRi2909
left a comment
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.
Strings are much better! - Thanks for addressing.
Regarding the code I'm not qualified for a full review.
Proposed change
Adds support in the Matter integration for configuring PIR occupancy “unoccupied → occupied” timing/threshold attributes via number entities, with accompanying fixtures and test coverage.
Matter Specs
PIRUnoccupiedToOccupiedDelayattributePIRUnoccupiedToOccupiedThresholdattributePIRUnoccupiedToOccupiedDelay, before the PIR sensor changes to its occupied state.Type of change
Additional information
Checklist
ruff format homeassistant tests)If user exposed functionality or configuration variables are added/changed:
If the code communicates with devices, web services, or third-party tools:
Updated and included derived files by running:
python3 -m script.hassfest.requirements_all.txt.Updated by running
python3 -m script.gen_requirements_all.To help with the load of incoming pull requests: