Hardening release from a dual-AI (Claude + Codex) adversarial review focused on HA-core compatibility and robustness. Also fixes the weekly hassfest failure.
Fixed
- Cost sensor state class —
MONETARYdevice class only permitsTOTAL; wasTOTAL_INCREASING, which HA core rejects for long-term statistics. - Stale-poll accumulator poisoning — the energy and cost accumulator sensors kept integrating power across failed coordinator polls, manufacturing phantom kWh from stale readings. They now skip integration and resync their clock while the poll is failing.
- API URL guards — 10
assert <url> is not Nonesites inapi.pyreplaced with a typed_require_url()raisingMixergyConnectionError;AssertionErrorescaped the error taxonomy and disappears underpython -O. - Options flow cross-field validation —
no_water_thresholdcan no longer be set at or abovelow_water_threshold; the form re-shows with a translated error (en/de/fr/it). - services.yaml schema drift — removed
area: {}anddevice:filters from servicetarget:blocks; hassfest now only acceptsentity:filters.
Added
- 4 regression tests covering the fixes above (76 total).
🤖 Generated with Claude Code