feat(text): add editable DHW timer-program schedule entities#675
Merged
Conversation
- Adds a new text platform exposing the DHW (Bw) circuit's active timer-program schedule (week/weekday-weekend/per-day) as 10 editable "HH:MM-HH:MM/..." entities instead of hundreds of per-row time entities. - Each entity reads/writes its block's underlying start/end parameters directly by raw name (bypassing the LuxParameter enum, which would need ~500 boilerplate members for this range), only writes rows that actually changed, and clears trailing rows when the string is shortened. - Entities dynamically report unavailable when their circuit's mode selector isn't set to the schedule shape they represent, so only the active schedule is editable at any time. - Other 5 timer-program circuits (Hkr/Mk1/Mk2/ZIP/Swb) intentionally deferred until this is validated; extending is additive per circuit.
- Closes a coverage gap: TimeOfDay was the only datatype override in this file without its own test class, unlike its siblings SecondsToHours and FrequencyAutomatic. Brings lux_overrides.py from 86% to 100% coverage.
Contributor
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
TimeOfDay/TimerProgramdatatype overrides for Luxtronik parameters 162-667 (the six timer-program schedule blocks), classifying the ~500 raw start/end time parameters and their 6 mode selectors correctly instead of leaving them asUnknown.textplatform exposing the DHW (Bw) circuit's active timer-program schedule as 10 editable"HH:MM-HH:MM/..."entities (week / weekday / weekend / one per day), instead of hundreds of individual per-row time entities.LuxParameterenum, which would need ~500 boilerplate members for this range), only writes rows whose value actually changed, and clears trailing rows when the string is shortened.unavailablewhen their circuit's mode selector isn't set to the schedule shape they represent, so only the currently active schedule is editable — no reload needed if the mode changes on the device.Bw) circuit is wired up so far, to validate the approach before rolling out to the other 5 timer-program circuits (Hkr/Mk1/Mk2/ZIP/Swb); extending is additive per circuit.Test plan
ruff check/ruff format --checkcleanbasedpyright— 0 errorspytest --cov=custom_components.luxtronik2— full suite passes, 99% coverage, new files at 100%tests/test_text.py: table-integrity check against the realluxtronik.Parametersregistry, schedule-string parsing, entity rendering/availability/diff-based-write behavior