Add rule1_time_window and rule1_weekday auto modes#133
Merged
Conversation
Two new opt-in select entities (default: manual) that let the user delegate management of the two rule 1 registers the integration was previously leaving alone: - rule1_time_window: auto → writes start_time=00:00, stop_time=23:59 (Felicity's 24-hour convention; firmware rejects stop=00:00 or stop=24:00). - rule1_weekday: auto → writes effective_week=0x7F (all 7 days). Implementation: - coordinator._apply_rule1_auto_settings() runs every cycle. Writes are idempotent: it reads the current register value back from self.data and only writes when the value differs from the target. After a successful write, self.data is updated locally so subsequent ticks immediately see the match and skip. - Called from the main update loop after _calculate_available_info so the warning check (_check_rule1_window_conflict) sees the corrected state in the same cycle. - Default is "manual" so existing user-configured restrictions are preserved unless the user explicitly opts into auto. This complements the rule1_window_warning (advisory banner) — users who don't want to manage rule 1's window themselves can flip both selects to auto and the warning will resolve automatically as the integration brings the registers into sync.
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.
Two new opt-in select entities (default: manual) that let the user delegate management of the two rule 1 registers the integration was previously leaving alone:
Implementation:
This complements the rule1_window_warning (advisory banner) — users who don't want to manage rule 1's window themselves can flip both selects to auto and the warning will resolve automatically as the integration brings the registers into sync.