refactor(integration): make Hypercolor first class in Home Assistant - #5
Open
hyperb1iss wants to merge 11 commits into
Open
refactor(integration): make Hypercolor first class in Home Assistant#5hyperb1iss wants to merge 11 commits into
hyperb1iss wants to merge 11 commits into
Conversation
Keep Git-Iris release notes while moving release-state decisions into a typed planner shared by create and resume paths. Validate release inputs before a single atomic main-and-tag push. Pin external actions, share Hypercolor setup, and add workflow, shell, and published-package compatibility gates to CI. Co-Authored-By: Nova (GPT-5.4) <noreply@openai.com> Co-Authored-By: Stefanie Jane <stef@hyperbliss.tech>
Replace the parallel coordinator maps and defensive field readers with one typed snapshot owned by the config entry runtime. Route every mutation through a shared refresh boundary and preserve idempotent effect stopping. Project first-class effect presets, zones, device state, diagnostics, and telemetry from the SDK models. Split the Home Assistant harness into focused contract, lifecycle, and daemon-backed scenarios so failures stay local. Co-Authored-By: Nova (Codex) <noreply@openai.com>
Document the effect-scoped preset contract, optional telemetry entities, and the complete Home Assistant automation service set. Repair end-to-end recipes after the harness split and make the full test recipe enforce the project coverage floor. Co-Authored-By: Nova (GPT-5.4) <noreply@openai.com>
The typed runtime owns one authoritative snapshot, so state, catalog, and device event categories no longer represented different refresh paths. Use one exact allowlist and prove telemetry plus refresh handling together. Remove the stale config-flow test module after its contracts moved into the Home Assistant flow suite. Co-Authored-By: Nova (Codex) <noreply@openai.com>
A long-lived healthy connection could become unavailable immediately after its first REST failure because grace was measured from the last success and CoordinatorEntity bypassed the explicit connection policy. Track one disconnect timestamp per source, derive every entity deadline from that clock, and keep changing retry errors from extending the grace period. WebSocket repair state follows the same authority as entity availability. Co-Authored-By: Laplace (Codex verifier) <noreply@openai.com> Co-Authored-By: Nova (Codex) <noreply@openai.com>
Daemon discovery still needs one raw identity request because the public SDK has no get_server method. Route output-power capability and authorization checks through HypercolorClient so transport, auth, models, and errors share the same contract as the loaded integration. Co-Authored-By: Laplace (Codex verifier) <noreply@openai.com> Co-Authored-By: Nova (Codex) <noreply@openai.com>
Device controls could remain available after discovery removed their backing device, and hub action buttons ignored daemon availability entirely. Share one coordinator-backed device entity base across lights, switches, and buttons. All controls now follow the typed runtime and live snapshot. Co-Authored-By: Laplace (Codex verifier) <noreply@openai.com> Co-Authored-By: Nova (Codex) <noreply@openai.com>
Snapshot failures raised repairs before their grace expired. Push traffic churned repair state. The WebSocket router missed events, leaving Home Assistant stale with polling off. Use one repair deadline for both transports, gated by health transitions. Refresh state event families. Classify only SDK failures as outages. Co-Authored-By: Laplace (Codex verifier) <noreply@openai.com> Co-Authored-By: Nova (Codex) <noreply@openai.com>
The source checkout recipe placed Hypercolor above the sibling path consumed by uv, and the Python requirement implied unsupported 3.15 compatibility. Keep both repositories adjacent and state the actual Python 3.14 range. Co-Authored-By: Laplace (Codex verifier) <noreply@openai.com> Co-Authored-By: Nova (Codex) <noreply@openai.com>
GNU base64 wraps a realistic GitHub token across multiple lines, which makes libcurl reject the optional authenticated SDK fetch. Strip encoded newlines and lock the behavior with a long-token regression test. Co-Authored-By: Laplace (Codex verifier) <noreply@openai.com> Co-Authored-By: Nova (Codex) <noreply@openai.com>
GitHub runners do not include just, so both source-backed verification and the isolated PyPI compatibility lane failed before reaching project gates. Install the same pinned runner through uv in both environments.
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.
💎 Summary
This rebuilds the integration around a single typed Hypercolor runtime instead
of parallel coordinator dictionaries and downstream wire reconstruction.
push telemetry.
presets, collision-safe labels, and modified-preset state.
Stop as a separate idempotent action.
availability tied to current snapshot membership.
client. Raw HTTP remains only for server identity, which the SDK does not yet
expose at its high-level boundary.
🌊 Runtime and WebSocket behavior
The integration subscribes before its initial refresh, retains the typed hello
capabilities, intersects optional channels, and treats resync messages as an
ordering barrier. State-bearing daemon event families trigger refreshes while
high-frequency telemetry stays on direct typed update paths.
Snapshot and WebSocket health share one source-aware outage model. Availability
and repair creation use the same stable deadline, changing retry messages cannot
extend an outage, and healthy push traffic does not churn the repair registry.
Unexpected integration exceptions remain programmer errors instead of being
misreported as daemon outages.
🛡️ Control and release safety
path replacement races.
dependency requirements are checked as executable metadata contracts.
atomically after the complete verification suite passes.
ShellCheck, and authenticated SDK fetches keep long Basic auth headers on one
line.
hypercolor==0.3.2package.🧪 Verification
just verify: 96 passed, 1 explicit live-daemon skip, 82.02% coverageThe live-daemon smoke test remains opt-in and was not run. No daemon or Home
Assistant service was started or restarted for this change.