Repository navigation
Dashboard: show settings read-only when a write tier is off - #19
Merged
Merged
Conversation
The Controls section always referenced number/switch entities. With a write tier off the bridge publishes those settings as sensor / binary_sensor, so the rows only worked while 2.1.0 left stale retained number/switch configs behind; 2.1.1 clears them and the rows vanished. - The generator takes the write tiers (--basic-writes / --safety-writes, default off) and renders each setting row in the matching domain. The note states per tier whether settings are editable or read-only. - The add-on passes its tier options to the auto-installed dashboard, which is rewritten on every restart, the same moment a tier change takes effect. - Legacy installs slug the read-only variants from the setting's description (verified against a real install's HA log; identical to python-slugify for all 34 settings). Controls keep the register name. - check_entities.py derives domains from the tiers and checks all four tier combinations in device naming. - mqtt.writable_component is public so dashboard and check share it. - Docs, TESTPLAN and regenerated sample; add-on version 2.1.2. Co-Authored-By: Claude Opus 5 (1M context) <noreply@anthropic.com>
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.
Summary
After 2.1.1 the dashboard's Basic settings and Safety thresholds rows disappeared on installs with write tiers off. The Controls section always referenced
number.*/switch.*, but with a tier off the bridge publishes those settings assensor/binary_sensor. The rows only worked because 2.1.0 left stale retained number/switch configs on the broker (#17), which 2.1.1 now clears.Functional requirement: settings are always visible read-only; a write tier makes them editable; tiers are off by default.
--basic-writes/--safety-writes, default off) and renders each row in the matching domain viasetting(). The note says per tier whether settings are editable or read-only.enable_basic_writes/enable_safety_writesto the auto-installed dashboard, rewritten on every restart, which is also when a tier change takes effect.sensor.bms_1_cell_voltage_below_which_the_bms_enters_smart_sleep), controls keep the register name. Verified against all 7 ids in the HA log from Read-only fallback publishes sensor/binary_sensor with entity_category "config", which Home Assistant rejects #16 and identical to python-slugify 9.0.0 for all 34 settings.check_entities.pyderives domains from the tiers; device naming checks all four tier combinations.mqtt._writable_component→writable_component(shared by dashboard and check).Test plan
ruff check,mypy src,pytest(549 passed, 100 % coverage)generate.pydrift check;check_entities.py --naming legacyand--naming device(4 tier combos)verify-entities.jinjashowsBMS n settings: 34/34, rows read-only🤖 Generated with Claude Code