Improve HomeKit tile responsiveness (v3.2.1)#25
Open
identd113 wants to merge 4 commits into
Open
Conversation
Three fixes for stale tile state: - async getState(): await a fresh device poll on every onGet so navigating to the tile always returns live state (~200ms latency, no stale cache) - Push CLOSING/OPENING immediately via updateValue() in changeState() so HomeKit-triggered commands show the transition state without waiting for the next poll - Update error-case test to use assert.rejects() for async onGet handler - Add assertions verifying updateValue() fires on changeState() Also adds CLAUDE.md with architecture overview and dev commands. Bump to 3.2.1. Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>
Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>
After a HomeKit open/close command, poll the device every 2 seconds instead of waiting the full openCloseDurationSecs. As soon as the device confirms the target state, clear lastTarget and push the final state to HomeKit immediately. If the door never reaches the target (obstructed, device unreachable), polling stops at openCloseDurationSecs and the regular poll loop takes over. The 2-second interval is a private constant — not user-configurable. Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>
Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>
Contributor
Author
|
After merge, it needs to be pushed to npm |
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
Three improvements to make the HomeKit garage tile reflect state changes faster, plus a CHANGELOG entry.
Immediate CLOSING/OPENING on HomeKit-triggered commands
Previously, tapping the tile to close/open sent the command but the tile stayed showing the old state until the next background poll. Now
CurrentDoorStateandTargetDoorStateare pushed viaupdateValue()immediately after the command is sent so the tile showsClosing/Openingwithout any delay.Rapid polling during transition
After a HomeKit command, the plugin now polls the device every 2 seconds instead of waiting the full
openCloseDurationSecswindow. As soon as the device confirms the target state,lastTargetis cleared and the final state is pushed to HomeKit. If the door never reaches the target (obstructed or device unreachable), rapid polling stops atopenCloseDurationSecsand the regular poll loop takes over — no infinite loops.Fresh state on tile navigation
getState()(onGethandler) is nowasyncand awaits a live device poll before returning. Navigating to the tile always shows current state (~200ms query) instead of whatever the last background poll captured.Test plan
npm test)Closing, thenClosedwithin 2s of door confirming closedpollFrequencySecsseconds as beforeopenCloseDurationSecs, tile shows "No Response"🤖 Generated with Claude Code