mirror of
https://github.com/Akkudoktor-EOS/EOS.git
synced 2026-11-25 15:06:20 +01:00
fix(genetic): date a run in progress in the time zone of the horizon
The start day of a run in progress decides which DAILY cycle it counts for. Take it in the time zone of slot 0, which also dates the cycles. The cycle counting test gave its times with a +01:00 offset, so on a runner in UTC the run started on the previous day and was rightly not counted for today. It now uses local times without offset and passes in local time zones from UTC-12 to UTC+14. Refs: #1548 Signed-off-by: SchaafAlexander <86607129+SchaafAlexander@users.noreply.github.com> Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com> Assisted-by: Claude Code (claude-opus-5-5)
This commit is contained in:
committed by
Bobby Noelte
co-authored by
Claude Opus 5.5
parent
4693e1fa97
commit
e40ff7f6e3
@@ -483,7 +483,11 @@ class HomeAppliance:
|
||||
)
|
||||
self.pinned_start_datetime = started
|
||||
self.pinned_end_datetime = max(started.add(seconds=self.run_duration_seconds), now)
|
||||
self.pinned_run_date = started.date()
|
||||
# The start day in the time zone of the horizon, which also dates the cycles.
|
||||
horizon_timezone = slot0_datetime.timezone
|
||||
self.pinned_run_date = (
|
||||
started.in_timezone(horizon_timezone) if horizon_timezone is not None else started
|
||||
).date()
|
||||
if elapsed >= self.run_duration_seconds:
|
||||
logger.info(
|
||||
"Home appliance '{}': run started {} is past its duration of {} s "
|
||||
|
||||
Reference in New Issue
Block a user