Skip to content

Fix solis timezone bug#3809

Merged
springfall2008 merged 2 commits intomainfrom
fix/solis_timezone
Apr 21, 2026
Merged

Fix solis timezone bug#3809
springfall2008 merged 2 commits intomainfrom
fix/solis_timezone

Conversation

@springfall2008
Copy link
Copy Markdown
Owner

Copilot AI review requested due to automatic review settings April 21, 2026 07:26
Copy link
Copy Markdown
Contributor

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 Solis V1 time-window slot detection using the correct (local) clock so Predbat doesn’t disable timed charge/discharge during an active forced discharge window (issue #3803).

Changes:

  • Use self.now_utc_exact (local timezone) for V1 slot comparisons instead of datetime.now(UTC).
  • Update Solis tests to mock the current time via an overridable now_utc_exact and add regressions covering discharge-slot detection and local-vs-UTC behavior.

Reviewed changes

Copilot reviewed 2 out of 2 changed files in this pull request and generated 1 comment.

File Description
apps/predbat/solis.py Switch V1 slot detection to use local-time (now_utc_exact) when determining whether the current time is inside a charge/discharge window.
apps/predbat/tests/test_solis.py Add/adjust V1 regression tests to validate correct discharge-slot detection and guard against UTC/local mismatch.

Comment on lines +12 to +13
from datetime import datetime
from unittest.mock import MagicMock
@springfall2008 springfall2008 merged commit 18a8364 into main Apr 21, 2026
1 check passed
@springfall2008 springfall2008 deleted the fix/solis_timezone branch April 21, 2026 07:33
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants