Skip to content

fix(integration): use authoritative output power state - #4

Merged
hyperb1iss merged 1 commit into
mainfrom
nova/pause-state-contract
Aug 12, 2026
Merged

fix(integration): use authoritative output power state#4
hyperb1iss merged 1 commit into
mainfrom
nova/pause-state-contract

Conversation

@hyperb1iss

Copy link
Copy Markdown
Owner

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

  • Independent adversarial review: PASS
  • Test suite: 81 passed, 1 explicit live-daemon skip
  • Ruff: passed
  • Ruff format: passed
  • ty: passed
  • Source lock resolution: passed against the pinned Hypercolor checkout
  • Workflow YAML parsing: passed
  • git diff --check: passed

No real Home Assistant instance or live lighting hardware was controlled.

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>
@hyperb1iss
hyperb1iss merged commit 2223f8a into main Aug 12, 2026
4 checks passed
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.

1 participant