fix(integration): use authoritative output power state - #4
Merged
Conversation
Route master off through non-destructive pause and retain selected preset provenance with an explicit modified state. Replace compatibility wrappers and mutating capability probes with the supported Python SDK contract. Make WebSocket state primary with ordered resync barriers and real availability. Normalize metrics, disable reconciliation polling by default, secure effect uploads against path swaps, and refresh devices dynamically. Co-Authored-By: Nova HASS Audit (Codex) <noreply@openai.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.
What changed
The Home Assistant master light now turns off through Hypercolor's desired paused state and resumes the existing scene without stopping the effect. The selected effect, preset provenance, Modified state, controls, bindings, and render phase remain intact.
The integration removes its local compatibility client and consumes the typed Python SDK directly. Setup no longer probes capabilities by mutating live controls. Stop is structurally idempotent, control-tier checks are non-mutating, and older daemons are capability-gated explicitly.
WebSocket state is now primary. Effect changes refresh both active state and the effect-scoped preset catalog, reconnects subscribe before reconciliation, resync barriers target the owning caches, authentication revocation starts reauthentication, and entities subscribe to every coordinator they read. Reconciliation polling is disabled by default and remains an explicit opt-in.
Connection availability now has observable state and a real grace timer. Metrics normalize the daemon's nested payload and update the correct sensors. Device entities appear dynamically as configured hardware is discovered.
Preset selection preserves canonical identity while exposing
active_preset_modified. Direct effect and preset actions await authoritative state and catalog refresh, so Home Assistant does not show a stale or empty selector after the service call returns.Service hardening validates administrator context, constrains effect uploads to allowed paths, checks size before reading, and detects path swaps. Obsolete compatibility string matching and constructor introspection are removed.
CI and release verification pin Hypercolor commit
978096e614695777d3cd13ea0b184877e46afd84, which carries the output-power and Python SDK contract consumed here.Why
The former master-off implementation called a Python helper that aliased pause to destructive effect stop. That released devices, cleared runtime state, and caused Hue, WLED, and preset restoration failures. The integration also carried mutating setup probes, stale cross-coordinator reads, placebo availability, and an unsafe arbitrary file upload surface.
Verification
git diff --check: passedNo real Home Assistant instance or live lighting hardware was controlled.