Repository navigation
5.18: a device's primary on/off state follows only its own kind of report - #3
Merged
Merged
Conversation
…port Every decoded report used to write onOffState on every companion device of the node, so a contact sharing a node with a siren, lock, dimmer or mains monitor was switched by those. 5.17 fixed this for Home Security events; this does the rest. - PRIMARY_FAMILIES / _set_primary(): a report of a family sets onOffState only where the device's type lists it, or the device is Generic: door/barrier -> Contact; lock (notification and Door Lock CC) -> Lock; switch binary/multilevel -> Plug and Energy; central scene / scene activation -> Scene; water, smoke, CO, gas, siren, mains power -> Generic. - Sensor Binary: typed reports use BINARY_PRIMARY_FAMILY (tamper and alarms Generic only); general-purpose / untyped reports still set every device. - Basic reports still set every device (untyped; older sensors rely on it). - Each report's own state (contact, sirenActive, ...) still updates wherever the device declares it. - tests/test_primary_state.py: every report kind x every device type (253 cases) through _route_zwave_report, plus two mixed-node scenarios. With the old behaviour put back at runtime, 180 fail. 536 passed in all. - Version 5.18: Info.plist, plugin.py header, README, docs/changelog.md. Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com> Claude-Session: https://claude.ai/code/session_019Z2FM7PBbhgq9QjrM5W2HY
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.
Summary
Every report the plugin decoded used to write
onOffStateon every companion device of the node. So a Contact device sharing a node with a siren, lock, dimmer or mains monitor was switched by those reports. For example, a siren going quiet showed an open door as closed. #2 (5.17) fixed this for Home Security events; this PR does the rest.Changes (
plugin.py)PRIMARY_FAMILIESand_set_primary(). A report of a given family setsonOffStateonly when the device's type lists that family, or the device is Generic:docs/devices.mdalready places alarms on the Generic Sensor, which is why the alarm family is Generic only.Sensor Binary. Typed reports go through
BINARY_PRIMARY_FAMILY. General-purpose and untyped (v1) reports still set every device's primary state, because their state key isonOffState.Basic is unchanged. It still sets every device's primary state, because it is untyped and older motion and door sensors use it as their only report.
Each report's own state is unaffected. States such as
contactandsirenActivestill update wherever the device declares them.Version 5.18 in Info.plist, the plugin.py header, the README and
docs/changelog.md. The changelog tells users to move any trigger that relied on a report of another kind onto that report's own state.Test plan
tests/test_primary_state.pysends every report kind to every device type (253 cases) through_route_zwave_report, plus two mixed-node scenarios.pytest: 536 passed. Ruff and compileall are clean. Run Parser Self-Test: 14 passed, 0 failed.Generated by Claude Code