2026.3.2
Went on a Bug hunt π
Bug Fixes
- Sync states blocking event loop β
sync_statesran database queries on the event loop, causing UI lag. Refactored to run all DB operations in the executor and pre-compute entity-area mappings to avoid O(nΓm) lookups. Fixes #388 in #403 - Entity evidence identity check β Used truthiness check (
not entity.evidence) instead of identity check (entity.evidence is False), incorrectly treatingNone(unavailable) as inactive. Now correctly distinguishes unavailable from inactive entities. Fixes #389 in #404 - Orphan cleanup missing tables β
_cleanup_area_orphansanddelete_area_datadid not clean upIntervalAggregates,CrossAreaStats,NumericSamples, orNumericAggregates, leaving stale data after area removal. All tables are now scoped and cleaned. Fixes #390 in #405 - Motion sensor type guard on reload β
load_datadid not verify that restored motion/sleep sensor entity IDs still had the correctInputType, allowing misclassified sensors to carry stale probabilities after reconfiguration. Added type guard validation. Fixes #391 in #406 - Prune timestamp not persisted β
set_last_prune_timeopened a session but never committed, so the prune timestamp was lost on restart, causing redundant full-table prunes on every cycle. Consolidated into a single transaction with the prune deletes. Fixes #392 in #407 - Duplicate person validation β Adding the same person entity to multiple people slots was silently accepted, causing undefined behavior. Now rejects duplicates with a clear error. Fixes #393 in #408
- Unavailable entities still decaying β Entities in unavailable state (
value is None) were still included in the probability calculation when decay was active, inflating occupancy probability. Now skipped regardless of decay. Fixes #394 in #409 combine_priorsunclamped early return β When only one area had data,combine_priorsreturned its raw prior without clamping, potentially producing values outside the 1β99% range. Now appliesclamp_probability()on all return paths. Fixes #395 in #410- Analysis exception scope too narrow β Analysis pipeline only caught
HomeAssistantError | OSError | RuntimeError, letting unexpected exceptions (e.g.,KeyError,TypeError) crash the coordinator. Broadened to catchExceptionwith full logging. Fixes #396 in #411 "nan"string not filtered β Entities reporting the string"nan"as their state were treated as valid, producingNaNin probability calculations. Added"nan"to the invalid states filter. Fixes #397 in #412- Lightweight config update crash β A single area failing during
_async_lightweight_config_updatewould abort the entire update loop, leaving remaining areas with stale configuration. Each area is now wrapped in its own try/except. Fixes #398 in #413 - WAL checkpoint errors silently suppressed β
contextlib.suppresson WAL checkpoint hid potentially actionable errors. Replaced with explicit try/except and warning-level logging withexc_info=True. Fixes #399 in #414 - Draft corruption on validation failure β Config flow updated
_area_config_draftbefore validating, so a validation failure left the draft in a partially-modified state. Now validates on a candidate copy first. Fixes #400 in #415 CONF_AREAStype safety βCONF_AREASwas assumed to be alist[dict]but could contain non-dict items after manual config edits or corruption. Added per-item type validation with warning logging. Fixes #401 in #416AnalysisStatusraw strings β Analysis status was tracked with raw string literals ("idle","running", etc.), risking typo bugs and making refactoring fragile. Replaced withAnalysisStatusenum values throughout. Fixes #402 in #417
A big thank you to those who have chosen to sponsor my work!
You can sponsor me here
Full Changelog: 2026.3.1...2026.3.2