Skip to content

Comments

fix: Disabled schedule not being persisted#24

Merged
hostcc merged 1 commit intomainfrom
fix/disabled-schedule-not-persisted
Sep 24, 2025
Merged

fix: Disabled schedule not being persisted#24
hostcc merged 1 commit intomainfrom
fix/disabled-schedule-not-persisted

Conversation

@hostcc
Copy link
Owner

@hostcc hostcc commented Sep 24, 2025

Fixed issue when disabled schedule reverts back to enabled upon reboot. That is due to winter_mode switch restores to OFF (apparently, when winter mode is disabled) triggering its turn_off_action, which turns off both controls to disable lawn and flowerbed sprinklers. The issue manifests itself only when winter mode is disabled.

The fix is to introduce the internal switches (for each of user-visible controls disabling each of schedules), those aggregate state of winter mode and the corresponding user-visible switch. The intermediate entity is then controlled by winter_mode switch, and prevents that affecting the state of the schedule might have been set by the user.

* Fixed issue when disabled schedule reverts back to enabled upon
  reboot. That is due to `winter_mode` switch restores to OFF
  (apparently, when winter mode is disabled) triggering its
  `turn_off_action`, which turns off both controls to disable lawn and
  flowerbed sprinklers. The issue manifests itself only when winter mode
  is disabled.

  The fix is to introduce the internal switches (for each of
  user-visible controls disabling each of schedules), those aggregate
  state of winter mode and the corresponding user-visible switch.
  The intermediate entity is then controlled by `winter_mode` switch,
  and prevents that affecting the state of the schedule might have been
  set by the user.
@hostcc hostcc self-assigned this Sep 24, 2025
@hostcc hostcc added the bug Something isn't working label Sep 24, 2025
@hostcc hostcc requested a review from Copilot September 24, 2025 20:24
Copy link

Copilot AI left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Pull Request Overview

Fixes an issue where disabled schedules would revert to enabled state after device reboot due to the winter mode switch restoration behavior affecting user-configured schedule states.

  • Introduces intermediate aggregate switches that combine winter mode state with user-visible schedule disable switches
  • Updates references to use the new aggregate switches instead of direct user switches
  • Prevents winter mode restoration from overriding user-configured schedule preferences

Reviewed Changes

Copilot reviewed 2 out of 2 changed files in this pull request and generated 3 comments.

File Description
schedule.yaml Added aggregate template switches that combine winter mode and user schedule states, updated schedule references
controllers.yaml Updated winter mode actions to control aggregate switches instead of direct user switches

Tip: Customize your code reviews with copilot-instructions.md. Create the file or learn how to get started.

@hostcc hostcc merged commit 580496e into main Sep 24, 2025
3 checks passed
@hostcc hostcc deleted the fix/disabled-schedule-not-persisted branch September 24, 2025 20:29
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

bug Something isn't working

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant