Audit 1/3: production - the fixes that run on the pump - #25
Draft
enoch85 wants to merge 1 commit into
Draft
Conversation
enoch85
marked this pull request as draft
July 15, 2026 14:33
enoch85
force-pushed
the
audit/1-production
branch
from
July 15, 2026 19:58
0d4d1e3 to
84c1872
Compare
Closed
enoch85
force-pushed
the
audit/1-production
branch
from
July 15, 2026 20:11
84c1872 to
fb88258
Compare
Everything the week-long audit changed about what runs on the pump, with the existing tests updated where behavior changed. The new test coverage and the simulator follow as two stacked PRs; the full red-first history lives on audit/safety-fixes-and-en442 (PR #24). Control and lifecycle: thermostat OFF is one fact and an atomic hardware transition; an unloaded coordinator cannot write; reads never drive the pump; one locked writer; user commands are real commands (and are refused while OFF); the adapter reports the integer it actually wrote. Tariff and storage: the bill is the hourly mean, one peak per day from three days, night hours at half weight; one fold-safe definition of the billed quantity with per-sample provenance; hours the meter slept through are refused; v1 quarter-era stores migrate instead of breaking setup. Models and physics: EN 14511 rating points verbatim with sources; each pump's factory aux-start; one complete ErP declaration for the F2040; flow temperature from the EN 442 emitter law, which no longer needs a forecast to run; the slab documentation says what its own model computes. Diagnostics and UI: dumps report the band production enforces; 24 sensors translated in five locales; offset is a temperature delta; the power validator only flags readings the hardware cannot produce. Run against main, the updated suite fails 556 tests and 40 files cannot import. Full suite green at this commit.
enoch85
force-pushed
the
audit/1-production
branch
from
July 15, 2026 20:14
fb88258 to
8ee951b
Compare
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.
Production code of the audit, standalone and green: every fix that changes what runs on the pump, with the existing tests updated to match. The new test coverage and the simulator follow in two stacked PRs (#B, #C), so this is the diff to review if you review only one.
Split note: the review asked for five topical PRs (control/lifecycle, tariff+storage, models/physics, diagnostics/UI, CI/tooling). The production change-set is interlocked through
const.pyandcoordinator.py— a file-level topical split leaves intermediate PRs that do not import. The five topics are the sections below instead; each lists its files.Control & lifecycle safety
entry.data), noRestoreEntitycopy; the pump and every owned actuator (offset, DHW lux, ventilation fan) are neutralized before the gate persists OFF, and OFF fails loudly if the hardware cannot confirm neutral. (climate.py,switch.py,coordinator.py)coordinator.py,__init__.py)force_offset/boost_heatingbypass startup observation (safety floor still applies), report the offset actually written, and raise when the integration is OFF.boost_dhwopens a window the price optimizer may not cancel (safety still may), itsdurationis enforced by us, and thetarget_tempargument — which reached nothing — is removed.round(), notint()truncation), and UI surfaces report what NIBE holds, not what the engine wished.Tariff & storage
billing_period.py): time-weighted, DST-fold-safe (the repeated 02:00 no longer deletes an hour), refuses hours the meter slept through, and carries per-sample provenance — a meter-dropout hour can never be billed as a meter measurement.KeyError.Pump models & physics
utils/emitter.py), which reproduces OpenEnergyMonitor's published tool to 0.00 °C — and no longer needs a weather forecast to run (leaving the weather dropdown blank used to silently disable it).Diagnostics & UI
current_offsetis aTEMPERATURE_DELTA(imperial users no longer see 0 °C as 32 °F); the power validator only flags readings the hardware cannot produce.Verification
Open, deliberately: F-124 (saturation trap — mechanism real, honest magnitude 1.4–1.7× excess aux, blocked on a heat-pump policy decision), effect-tariff configurability after the Ellevio repeal (F-107), pre-heat sizing (F-130b), F-112 ladder rescale (parked in stash).