Repository navigation
v5.4.0 - #98
Merged
Merged
v5.4.0#98
Conversation
Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
…is named once, not every cycle Co-Authored-By: Claude Fable 5 <noreply@anthropic.com>
…ed pin logs at debug, not warn Co-Authored-By: Claude Fable 5 <noreply@anthropic.com>
…it gets live updates too Co-Authored-By: Claude Fable 5 <noreply@anthropic.com>
Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
Closed
Contributor
There was a problem hiding this comment.
🟡 Changes recommended
Unresolved synchronization races can overwrite newer characteristic state, reopen connections after client destruction, and remove subscriptions after failed reads.
8 open issues
Propagate each service read's outcome to synchronization · New Invalidate pending synchronizations on destroy or monitor replacement · New Prevent stale refreshes from overwriting newer characteristic state · New Use the supported instanceAllowList configuration property · New Retry failed late-bridge synchronization on discovery cycles · New Preserve explicit service selections during synchronization · New Log raw exchanges before throwing on HTTP errors · New Retain pinRefusalLogged as a deprecated optional HapInstance field · New
What changed in this PR
Promotes HAP Client v5.4.0 to the stable release, migrating HTTP requests to fetch and improving characteristic status handling, bridge discovery, and live monitoring.
Changes:
- Adds characteristic error statuses, raw diagnostic logging, and support for empty write responses.
- Updates monitor synchronization and PIN-refusal handling.
- Refreshes dependencies, examples, package contents, and release tooling.
| File | Description |
|---|---|
| tsconfig.json | Reformats compiler option arrays. |
| test/test.js | Adds a manual characteristic and monitoring diagnostic. |
| test/backyard-tree.sh | Adds a direct temperature polling script. |
| src/monitor.ts | Adds packet logging, status refreshes, and bridge synchronization. |
| src/monitor.test.ts | Tests monitor synchronization and event handling. |
| src/interfaces.ts | Updates characteristic status and bridge interfaces. |
| src/index.ts | Migrates HTTP requests and updates discovery and monitoring behavior. |
| src/index.test.ts | Migrates mocks to fetch and adds regression coverage. |
| src/hap-types.ts | Adds proximity-control type mappings. |
| src/eventedHttpClient/index.ts | Exposes outgoing packets for diagnostic logging. |
| src/eventedHttpClient/index.test.ts | Reformats existing request-length tests. |
| src/eventedHttpClient/httpParser.ts | Reformats parser expressions without changing behavior. |
| README.md | Documents raw logging and availability refreshes. |
| package.json | Sets v5.4.0, updates dependencies, and limits published files. |
| nodemon.json | Adds automatic example rebuilds and restarts. |
| examples/README.md | Documents accessory monitoring examples. |
| examples/backyard-tree.js | Adds an accessory inspection and monitoring example. |
| eslint.config.mjs | Reformats an existing lint rule. |
| CHANGELOG.md | Records v5.4.0 changes and breaking behavior. |
| .npmignore | Removes exclusions in favor of the package allowlist. |
| .github/workflows/release.yml | Adds a package publishing summary. |
Review effort: Balanced
* fix: empty HAP characteristic write responses * Refactor test for setCharacteristic with multiple status codes Co-authored-by: Copilot Autofix powered by AI <175728472+Copilot@users.noreply.github.com> * Fix empty read response handling Co-authored-by: Copilot <223556219+Copilot@users.noreply.github.com> --------- Co-authored-by: Copilot Autofix powered by AI <175728472+Copilot@users.noreply.github.com> Co-authored-by: Copilot <223556219+Copilot@users.noreply.github.com>
Date the 5.4.0 entry, describe the breaking characteristic `value`/`status` change and the features it left out, and pin the hap-nodejs note to beta.6. Remove axios, which src stopped importing when fetch replaced it. Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
…r syncs getResource: fetch resolves on an HTTP error status where axios rejected, so a 401/470/500 returned undefined and the refused-pin error was never raised. Reject on !response.ok again. syncMonitorInstance: getAccessories() swallows a failed read, so a bridge that had just restarted after a configuration change was handed an empty service list and dropped from the monitor. On a failed read, reconnect the existing subscriptions as 5.3.0 did. Both raised by Copilot on #97. Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
Replace the .npmignore denylist with a files allowlist, so examples, test scripts, nodemon.json and .vscode no longer ship. Drop the source maps too: they point at ../src, which is not published. 31 files / 309 kB unpacked -> 18 files / 211 kB. Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
jsonc/sort-array-values moved "!dist/**/*.map" ahead of "dist", where npm no longer applies the exclusion, so the maps shipped again. The maps point at ../src, which is not published, so turn sourceMap off instead and keep the allowlist to CHANGELOG.md and dist. Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
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.


Breaking Changes
getCharacteristic()andrefreshServiceCharacteristics()now setstatuson each characteristic and throw aHapCharacteristicError(checkerror.name) when it is nonzero, leavingvalueat its last good reading. Before, they only logged the error, so a stalevaluelooked current.Changed
debugRawPacketsoption (withdebug: true) logs raw event-monitor packets andgetValue()exchanges. They can contain the bridge PINStatusActivechanges, refresh its other characteristics before emittingservice-updatesetCharacteristic()andsetCharacteristics()treat an empty (204) reply from the bridge as success again. Since the switch to fetch they had thrownFailed to control accessoryeven though the write worked (Fix empty HAP characteristic write responses #95)axiosdependencyRelease notes
beta-5.4.0tolatest. Replaces Release v5.4.0 #97, which came from a separaterelease-5.4.0branch that has now been removed. The code is identical.getResourcerejecting HTTP errors again, and a failed monitor sync reconnecting the bridge's existing subscriptions (both restore 5.3.0 behaviour, from the Copilot review on Release v5.4.0 #97); removal of the unusedaxiosdependency; a publish summary in the release workflow; and afilesallowlist that ships onlydist, README, LICENSE and CHANGELOG.🤖 Generated with Claude Code