Skip to content

v2.4.0

Choose a tag to compare

@hjdhjd hjdhjd released this 18 Sep 22:58
· 172 commits to main since this release

2.4.0 (2026-09-18)

  • New feature: mDNS service discovery. discoverServices browses one service type for you over a dual-stack RFC 6762 querier and hands back what a plugin wants: a pure classify from a resolved service to your own device, an ordered stream of what appeared, changed, and went away, a live snapshot, and a promise that says when the first look is over. The browser double ships on the testing entry so your discovery tests run on virtual time, and WakeableWait lets a connect loop sleeping out a retry wake the moment discovery hands it a new candidate.
  • New feature: a plugin-hosted HTTP listener shaped to the library's lifecycle model - its lifetime an AbortSignal, its port retried while something else holds it, exact-path and catch-all routes with the methods you name, a bounded body read, and a teardown that releases the port rather than leaking it across a reload. A companion probe answers the local address routed toward a host, in whichever family the host resolves to.
  • New feature: DeliverySupervisor, for the plugin that sends a command and then waits for the world to agree it happened. Open a window, name the slots you will answer, arm one deadline on the injected clock, and every waiting consumer is answered exactly once however the window ends.
  • New feature: every wait in the library now runs on the injectable clock - callback timers, deadline signals, watchdogs, codec probes, and awaited delays alike - so one TestClock drives every timeout your plugin inherits, and a timer can be told not to hold the process open. AsyncQueue joins the primitives as the single-consumer FIFO you reach for when something arrives on its own schedule and the code that wants it is an await away.
  • New feature: HomeKit projection helpers. A Not-Responding wrapper refuses every characteristic read with your HAP status error while a device is unavailable; updatePresenceCharacteristic keeps a characteristic on a service for as long as its metric reports, holding the last reading through a quiet spell; validCharacteristic gates a characteristic on a service the way validService gates a service on an accessory; and a shared sweep writes one characteristic to every service that carries it.
  • New feature: choice-bearing feature options. Declare a choices list on a value option - inline label and value pairs, or the name of a choice source your plugin registers and resolves against the device in view - and the settings page renders the control the declaration calls for: a dropdown or radio group for a single selection, with the presentation yours to declare or the framework's to pick, and a checkbox group when the option declares multiple. Selection matches case-insensitively and always answers in the domain's own spelling.
  • New feature: list editing for free-form multi-value options. A value option collecting several entries is edited as a list - each entry individually removable beside the field the next one is typed into - rather than one delimiter-packed text field.
  • New feature: a sanctioned toolkit for feature-option scope addresses. Compose an address through the engine's own grammar, screen an identifier with the exported predicate, or repair one with the sanitizer - the same character set and separator rule the engine parses by, stated once - and the write path validates addresses by that rule, so an address your plugin builds from device ids cannot drift from what the engine reads back.
  • New feature: a sidebar group-order comparator on the feature-options page, so a plugin places its device groups deliberately instead of accepting alphabetical order.
  • New feature: an onLoaded hook on the feature-options page, fired once per loaded model at the moment the page is established, and one page-lifetime catalog fetch that the boot and every plugin read share - bounded and validated once.
  • New feature: scope-describer builders on the feature-options documentation renderer, so your generated Feature Options reference describes controller and device scopes in your topology's own language.
  • New feature: a status row can carry a choices list. Declare the row's vocabulary and your server pushes the device's current selections - the panel renders them as a read-only multiselect, checkbox glyphs flowing left beneath the row's label and wrapping only when the panel genuinely runs out of width. It reports and answers nothing: no hover, no cursor, no control affordance.
  • New feature: the status panel hosts an optional plugin content dock. Supply statusPanel.contentPanel and your plugin renders its own content beneath the live grid, refreshed per device selection, while the framework keeps the grid itself.
  • New feature: a declared MQTT topic surface. Declare your plugin's whole topic catalog once and every publish and subscribe site takes its tails and log labels from it, with placeholders guarded at compile time and refused at runtime. The new prepare-mqtt CLI verb projects the catalog into your MQTT documentation, and every publish verb takes a change-gated option that skips a payload identical to the last one published on that topic.
  • New feature: a dedicated homebridge-plugin-utils/testing entry point carrying the library's shipped test support in one place: the silent and capturing loggers, the formatted-line log finders, the waitUntil poll, the helpers that walk a test clock through awaited delays, the runtime-floor guard machinery, and every shipped double - the clock, the fMP4 builders, the recording process, the socket, a recording MqttClient with a refusal lever and on-demand delivery, and the mDNS browser with makeService composing the services it announces. Your tests consume the same doubles the library's own suite trusts.
  • New feature: a pooled API dispatcher factory. createApiDispatcher builds the family's vetted undici pool - HTTP/2, one warm connection, the retry interceptor over the shared retry-status list, your user-agent stamp - from a single options bag, so a plugin's API layer starts from the vetted defaults rather than re-deriving them.
  • New feature: a shared transport-error classifier. classifyTransportError reads any thrown transport failure into one kind-tagged record - your lifetime signal outranks every shape reading - so retry and messaging logic branch on one vocabulary instead of parsing undici's shapes by hand, and it exports the type of its coded kinds, so you can key an exhaustive table on the library's own concept.
  • New feature: CoalescingTask, a single-flight task runner: one asynchronous pass at a time, with a burst of triggers arriving mid-pass collapsing into exactly one follow-up pass - built for the refresh storm where five events deserve two refreshes, not five. request() answers with the verdict of the pass that served it, so a caller can await the work it asked for, and a follow-up a trigger bought during a pass that then fails still runs.
  • New feature: an order-preserving membership diff for reconciling reported ids against configured ones - what appeared and what went away, in the order the source reports them.
  • New feature: debugGatedLog, the config-gated debug logging primitive every plugin has been hand-rolling. Wrap your logger once and your plugin's debug output emits at warn level whenever your own gate answers true - visible regardless of Homebridge's global debug switch - with the predicate read on every call, so a just-changed setting reaches the very next line and a per-device gate is just a closure over your own option lookup.
  • New feature: a console-backed logger for plugin UI servers - silent on its debug channel, every other channel written to the console the Homebridge UI captures - so your ui-server speaks the family's log shape without hand-rolling a logger.
  • Improvement: one configurable exponential-backoff ladder, with the default retry policy and the log client's reconnect curve both derived from it.
  • Improvement: the engine exposes a value-centric option's declared default, and valueList can opt into substituting it for an option enabled with nothing stored.
  • Improvement: the plugin config session owns the save direction alongside its read and stage conduits, so staged changes persist through the same session that read them.
  • Improvement: device-list outcomes speak with your voice. A getDevices failure outcome carries plugin-supplied headline and guidance copy, and a first-class nothing-to-list outcome renders your notice in place of the option table - an empty system reads as a described state rather than an error - and a getControllers failure carries the same headline and guidance.
  • Improvement: the feature-options sidebar's refresh control centers its glyph exactly, rather than a hair low wherever the host font's metrics happened to seat it.
  • Improvement: the live status panel lays identity and state cells on one shared column grid: a state value reads in the column its identity label heads, and the identity line holds to a single row and trims each cell to an ellipsis as the panel narrows.
  • Improvement: the status panel's error-reason vocabulary gains not-ready, misconfigured, unsupported, and throttled - each with sensible default copy, each overridable like the rest.
  • Improvement: publishGuarded, MqttClient's fire-and-forget counterpart to publish. It returns nothing and never rejects - a delivery failure lands in the log naming the full topic, while a publish cancelled by shutdown or a per-publish signal drops to a debug line, because a teardown race is the lifecycle working, not an error worth shouting about.
  • Improvement: MqttClient refuses a publish while disconnected with a typed offline error rather than queuing it silently, exposes its connection state, and its broker error line says when automatic reconnection is disabled - the answer to a missing publish now lives at the call site.
  • Improvement: a runtime Categories mirror joins the Homebridge enum mirrors. Assign accessory categories by name - Categories.WINDOW_COVERING, no literal cast, no hand-verifying values against hap-nodejs - with the full upstream member set mirrored and the compiler enforcing lockstep, so a mirror that drifts from hap-nodejs cannot build, let alone ship. A runtime HAPStatus mirror joins it, for raising characteristic errors by name under the same lockstep.
  • Improvement: the duration formatters gain a day tier above the hour rung - an uptime measured in days renders in days, not a ballooning hour count.
  • Improvement: a read-only command-line view on the FFmpeg process, so diagnostics can report exactly the invocation that ran.
  • Improvement: a documentation-index entry can point outside the repository, so a doc hosted elsewhere joins the stamped chrome's index like any local file.
  • Improvement: the documentation verbs gain a check mode that names every target that would change and writes nothing - a CI gate for stale docs - and prepare-chrome stamps the config schema's footer from the manifest and takes an offline mode that leaves a remote project list unfetched.
  • Improvement: the shared TypeScript base splits into library and plugin profiles, so a plugin build emits no declaration files, and the shared ESLint preset tightens - warnings fail the run by default as in CI, unused parameters report, duplicate imports are refused, and underscore separators in numeric literals are barred.
  • Improvement: hblog reports a usage error when --otp is supplied without --user and --pass, and toStartCase capitalizes a word opening with a letter in any script, not only ASCII.
  • Fix: a timer, a deadline, or an awaited delay longer than 24.8 days fires when asked - the clock carries a delay past the platform timer's ceiling itself, so no plugin clamps for it.
  • Fix: waitWithSignal delivers a promise that had already settled even under a signal that had already aborted, so a stream request that starts after an assembler's lifetime ended still hands over what was assembled.
  • Fix: a datagram socket from the library's factory sends to an address literal without a resolver round trip, so each send goes out under the multicast interface set just before it.
  • Fix: the option table defers to an active connection error and fills in once a device outcome lands cleanly, rather than racing the error view for the page.
  • Fix: in dark mode a picker group and a list editor sit on the row surface rather than glaring white.
  • Fix: the MQTT client keeps reconnecting after a broker hostname fails to resolve, treating a DNS failure as the transient it usually is.
  • Fix: caller-supplied video filters apply to HKSV recordings on the encoder's own filter chain exactly as they do to live streams, and the recording-only fMP4 options now live on the recording options type where they apply.
  • Fix: every duration and size formatter rounds to one decimal and drops the decimal from a value that rounds whole, at every tier.
  • Fix: the stamped webUI bundle's content hash digests identically on every host, so a build on macOS and one on Linux agree on the bundle name.
  • Housekeeping.