Adapter: controller, config flow, entities, e2e tests - #3
Merged
Conversation
leiklier
force-pushed
the
feat/core
branch
2 times, most recently
from
July 23, 2026 19:10
cb2a6c0 to
ba47c96
Compare
Owner
Author
|
Follow-up commit: |
Controller normalizes HA entities into input snapshots (domain-aware: zones count occupants, media players are truthy while playing), feeds physical light reports to the ledger, reconciles the switch as single writer (armed only after entity restores land), and keeps one timer for next_review tightened to a publish cadence while burning. Per-light device with number.target_hours (restorable knob), switch.enabled (standby escape hatch), an enum state sensor with reason attribute, and a lit-today duration sensor (0.1 h quantized, publish- gated for recorder discipline, persists the exact ledger for rule 5.1 restore). Config flow: light + visibility signals; options flow adds timing tunables. en + nb translations, icons, migration guide for the live instance. 23 adapter tests including full-day e2e scenarios and a zero-writes-under-churn recorder sweep. Co-Authored-By: Claude Fable 5 <noreply@anthropic.com>
New trigger_entities option: the controller subscribes to their transitions separately (their level never enters the snapshot) and pulses the engine's activity clock on every real state change — unknown/unavailable flaps and attribute-only writes are filtered. Config-flow field, en+nb translations, README; migration guide now maps binary_sensor.soverom_dor as a trigger for both lights, reproducing the legacy instant cut on door-open without an open door ever blocking the schedule. e2e test: night cut, relight-while-open, unavailable flap. Co-Authored-By: Claude Fable 5 <noreply@anthropic.com>
Options → Timing gains refuge_hold_seconds and exposure_grace_seconds; en+nb translations, README. e2e test: a coffee run (kitchen viewer firing while the office sensor decays) never toggles the WFH block, a door pulse during refuge is ignored, and someone settling within sight still cuts after the grace. Co-Authored-By: Claude Fable 5 <noreply@anthropic.com>
Owner
Author
|
Follow-up commit: |
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
Everything between Home Assistant and the core:
next_reviewtimer tightened to a 6-min publish cadence while burning.number.…_target_hours(restorable 0–20 h knob),switch.…_enabled(standby escape hatch, rule 4.3), enumsensor.…_statewithreasonattribute,sensor.…_lit_today(duration,state_class total+last_resetat the anchor, 0.1 h quantized, publish-gated; persists exact ledger attrs for rule 5.1 restore).Tests (23; suite total 56, 99 % cov)
Config-flow contract + duplicate guard + options roundtrips, normalization table, lifecycle/reload, full-day e2e on a real
input_boolean(sleep/wake/night movement, veto+refuge, budget cap & lit-today reset at anchor, manual flip reconciled, standby accounting, restore across reload), and a recorder-discipline sweep asserting zero state writes across all four entities during 24 rounds of input churn.Part 3 of 3, stacked on #2.
🤖 Generated with Claude Code