Skip to content

v5.4.0 - #98

Merged
NorthernMan54 merged 12 commits into
latestfrom
beta-5.4.0
Oct 31, 2026
Merged

NorthernMan54 merged 12 commits into
latestfrom
beta-5.4.0

Conversation

@NorthernMan54

Copy link
Copy Markdown
Contributor

Breaking Changes

  • Retired the usage of axios for making HTTP requests. Now uses fetch instead.
  • getCharacteristic() and refreshServiceCharacteristics() now set status on each characteristic and throw a HapCharacteristicError (check error.name) when it is nonzero, leaving value at its last good reading. Before, they only logged the error, so a stale value looked current.

Changed

  • feat: debugRawPackets option (with debug: true) logs raw event-monitor packets and getValue() exchanges. They can contain the bridge PIN
  • feat: when a service's StatusActive changes, refresh its other characteristics before emitting service-update
  • fix: setCharacteristic() and setCharacteristics() treat an empty (204) reply from the bridge as success again. Since the switch to fetch they had thrown Failed to control accessory even though the write worked (Fix empty HAP characteristic write responses #95)
  • fix: remember a refused pin on the client, so an unregistered bridge is named once, not every cycle
  • feat: take the list of our own bridges, so another homebridge's refused pin logs at debug, not warn
  • fix: add a bridge that registers after the monitor started to it, so it gets live updates too
  • chore: remove the unused axios dependency
  • chore: run the type generator with tsx instead of ts-node
  • chore(deps): dependency updates

Release notes

  • Promotes beta-5.4.0 to latest. Replaces Release v5.4.0 #97, which came from a separate release-5.4.0 branch that has now been removed. The code is identical.
  • Since beta.8, the betas added: getResource rejecting 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 unused axios dependency; a publish summary in the release workflow; and a files allowlist that ships only dist, README, LICENSE and CHANGELOG.
  • The breaking changes above ship in a minor release. homebridge-config-ui-x 5.29.1 already runs against them through the betas.

🤖 Generated with Claude Code

NorthernMan54 and others added 5 commits October 25, 2026 09:45
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>
@NorthernMan54 NorthernMan54 mentioned this pull request Oct 31, 2026
@NorthernMan54
NorthernMan54 requested review from bwp91 and a balanced review from Copilot October 31, 2026 15:28

Copilot AI left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

🟡 Changes recommended

Unresolved synchronization races can overwrite newer characteristic state, reopen connections after client destruction, and remove subscriptions after failed reads.

8 open issues
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

Comment thread src/index.ts Resolved
Comment thread src/index.ts Resolved
Comment thread src/monitor.ts Resolved
Comment thread examples/backyard-tree.js Resolved
Comment thread src/index.ts Resolved
Comment thread src/index.ts Resolved
Comment thread src/index.ts Resolved
Comment thread src/interfaces.ts Resolved
bwp91 and others added 7 commits October 31, 2026 17:35
* 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>
@NorthernMan54
NorthernMan54 merged commit f85a979 into latest Oct 31, 2026
19 checks passed
@NorthernMan54
NorthernMan54 deleted the beta-5.4.0 branch October 31, 2026 19:00
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

4 participants