Fix: Warn about very large Keymaster lock configurations#690
Conversation
|
Codecov Report✅ All modified and coverable lines are covered by tests. Additional details and impacted files@@ Coverage Diff @@
## main #690 +/- ##
==========================================
+ Coverage 84.14% 93.09% +8.94%
==========================================
Files 10 42 +32
Lines 801 5112 +4311
Branches 0 30 +30
==========================================
+ Hits 674 4759 +4085
- Misses 127 353 +226
Flags with carried forward coverage won't be shown. Click here to find out more. ☔ View full report in Codecov by Harness. 🚀 New features to boost your workflow:
|
0f9439b to
b0c9952
Compare
b0c9952 to
d639f84
Compare
d639f84 to
9d411b7
Compare
9d411b7 to
bd2131f
Compare
bd2131f to
db23564
Compare
db23564 to
b504878
Compare
ae01807 to
cf09d06
Compare
4d43fad to
309be18
Compare
309be18 to
bd2c919
Compare
Add projected entity-count repairs warnings for large single-lock configurations and auto-clear them when counts fall below the warning threshold. Closes FutureTense#679 Part of FutureTense#670
bd2c919 to
5f74de4
Compare
Line-by-line code review of PR #690: "Fix: Warn about very large Keymaster lock configurations"Review Status: 🟡 APPROVED with minor improvement suggestions 🔍 Architectural Walkthrough
|
|
Quick clarifications on the three warnings, all against current head 1. binary_sensor_count = slots + (1 if supports_connection_status else 0)It conditionally counts the provider's connection-status binary sensor, mirroring what the provider actually creates. Removing it would make the projection undercount for providers that expose that sensor. 2. hass_data = hass.data.setdefault(DOMAIN, {})
if LARGE_LOCK_ACK_DATA in hass_data:
return hass_data[LARGE_LOCK_ACK_DATA]
3. |
firstof9
left a comment
There was a problem hiding this comment.
This looks like it should get the job done properly.
Part of #670
Closes #679
What
Adds a Home Assistant Repairs warning when a single keymaster lock's projected entity count reaches 8000 entities (HA's per-dispatch event guard trips at 10,000). The repair is fixable — an acknowledgement: selecting Fix opens a confirm step ("here be dragons") that records that the user understands the risk and dismisses the warning. Two thresholds: 8000 raises the acknowledgeable warning; 9500 (critical, nearing the 10k guard) re-raises even after acknowledgement because the risk has materially worsened. It also auto-clears when the projected count drops back below 8000. Acknowledgement is persisted per-lock in a dedicated HA Store (survives restarts; no config-entry reload), preserved across disable/unload, and cleared on removal / below-threshold / critical re-alert.
Details
repairs.py(fixable acknowledgement fix flow) and a dedicated ack Store. Translations cover the issue text and the fix-flow confirm step. Unit tests cover projection (parent/child, DOW on/off, door-sensor sentinel), the 8000 boundary, >10000 warn-only/no-cap, setup-time stale clearing, disabled/unload ack preservation vs removal cleanup, the two-threshold + critical re-alert logic, and the fix-flow confirm/abort paths.