Don't start the alarm immediately after a restart

This commit is contained in:
Sven van Heugten 2026-01-18 08:00:27 +01:00
parent e5141d528e
commit 3d84bb6435

View file

@ -130,7 +130,7 @@ type NightLightStateMachine private (maybeState: NightLightState option) =
let maybePreviousPartOfDay = let maybePreviousPartOfDay =
maybeCurrentState |> Option.map _.Time |> Option.map getPartOfDay maybeCurrentState |> Option.map _.Time |> Option.map getPartOfDay
maybePreviousPartOfDay <> Some Day && newPartOfDay = Day maybePreviousPartOfDay = Some Night && newPartOfDay = Day
newDayStarted newDayStarted
|| maybeCurrentState |> Option.map _.Alarm |> Option.defaultValue false || maybeCurrentState |> Option.map _.Alarm |> Option.defaultValue false