Repository navigation
5.17: a Home Security "all clear" clears only what has ended - #2
Merged
Merged
Conversation
- An idle notification (event 0x00) names the event that ended in its first event parameter. It used to clear motion AND tamper whatever it named, so motion ending hid a tamper still active. Now a named idle clears only that event (motion family -> motion; tamper -> tamper); an idle naming nothing clears both, as before. Same rule as zwave-js 15.31.2 (lib/node/CCHandlers/NotificationCC.js), checked in the published package. - Home Security events drive onOffState only on Motion and Generic devices. A contact on a node that also reports tamper or motion had its primary state set by those events, so a tamper clearing showed an open door as closed. The motion and tamper states still update on every device that has them. - displayStatus after an idle shows what is still active. - Tests: the two idle xfails now pass (markers removed); new tests for named and unnamed idles, each motion-family event, unrelated events, the properties-byte flags, contacts and generic devices. 281 passed. - Version 5.17: 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
3 of 4 tasks
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
This fixes the idle-notification fault left open by #1, which still had two
xfail(strict)tests for it.The rule comes from the zwave-js source. I checked it in the published zwave-js 15.31.2 package, in
lib/node/CCHandlers/NotificationCC.js. A Notification "idle" (event0x00) names the event that ended in its first event parameter, and only that one is reset. An idle with no parameter resets everything:Changes (
plugin.py)_handle_home_security_idle():0x01 0x02 0x05 0x06 0x07 0x08, which this plugin records asmotion) clearsmotion, and a tamper (0x03,0x09) clearstamper.displayStatusthen shows whatever is still active._extract_idle_event(): reads the first event parameter. It uses the same layout as_extract_notif_user, with the low 5 bits of the properties byte as the length.onOffState: Home Security events now set it only on Motion and Generic devices. Before, a contact on a node that also reports tamper or motion had its primary state set by those events, so a tamper clearing showed an open door as closed. Themotionandtamperstates still update on every device type that declares them.docs/changelog.md.Not in scope
Access Control door events on a motion device, and
SENSOR_BINARYreports, still writeonOffStatewhatever the device type. It's the same class of issue, but outside the idle handling.Test plan
pytest: 281 passed, and ruff is clean. The two idlexfails now pass and their markers are removed. 16 new tests cover named and unnamed idles, each motion-family event, unrelated events, the properties-byte flag bits, contacts and generic devices.Generated by Claude Code