Commit 404bdce
fix: CRITICAL - Night Smart Charge time window validation (v1.4.1)
Fixed critical bug causing Night Smart Charge to start at incorrect times
(e.g., 19:50) instead of waiting for configured time (e.g., 01:00).
Problem:
- Night Charge started at any time after configured hour on same day
- Example: At 19:50, system checked "19:50 >= 01:00 TODAY" = TRUE
- This caused immediate charging activation outside intended window
Root Cause:
- Line 336 used time_string_to_datetime() which returns time on current day
- This didn't account for times that have already passed today
Solution:
- Changed to time_string_to_next_occurrence() which correctly handles:
* If time passed today → returns tomorrow's occurrence
* If time not passed → returns today's occurrence
Changes:
- night_smart_charge.py:336 - Use time_string_to_next_occurrence()
- const.py - VERSION = "1.4.1"
- manifest.json - version = "1.4.1"
Impact:
✅ Night Charge now starts only at configured time
✅ No premature charging after sunset
✅ Reliable overnight scheduling
🔴 CRITICAL FIX - Makes Night Smart Charge reliable for scheduling
🤖 Generated with [Claude Code](https://claude.com/claude-code)
Co-Authored-By: Claude <noreply@anthropic.com>1 parent 1a34a7c commit 404bdce
3 files changed
Lines changed: 3 additions & 3 deletions
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
2 | 2 | | |
3 | 3 | | |
4 | 4 | | |
5 | | - | |
| 5 | + | |
6 | 6 | | |
7 | 7 | | |
8 | 8 | | |
| |||
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
1 | 1 | | |
2 | 2 | | |
3 | 3 | | |
4 | | - | |
| 4 | + | |
5 | 5 | | |
6 | 6 | | |
7 | 7 | | |
| |||
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
333 | 333 | | |
334 | 334 | | |
335 | 335 | | |
336 | | - | |
| 336 | + | |
337 | 337 | | |
338 | 338 | | |
339 | 339 | | |
| |||
0 commit comments