Skip to content

Commit c8432bf

Browse files
committed
Fix timezone handling in optimization logging
1 parent c69c4ce commit c8432bf

File tree

1 file changed

+2
-2
lines changed

1 file changed

+2
-2
lines changed

src/eos_connect.py

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -72,6 +72,7 @@ def formatTime(self, record, datefmt=None):
7272
config_manager.config.get("load", {}).get("source", ""),
7373
config_manager.config.get("load", {}).get("url", ""),
7474
config_manager.config.get("load", {}).get("load_sensor", ""),
75+
#config_manager.config.get("load", {}).get("wallbox_sensor", ""),
7576
config_manager.config.get("load", {}).get("access_token", ""),
7677
time_zone,
7778
)
@@ -864,12 +865,11 @@ def run_optimization_event(sc):
864865
minutes, seconds = divmod(sleeptime, 60)
865866
logger.info(
866867
"[Main] Next optimization at %s. Sleeping for %d min %.0f seconds\n",
867-
next_eval.strftime("%H:%M:%S"),
868+
next_eval.astimezone(time_zone).strftime("%H:%M:%S"),
868869
minutes,
869870
seconds,
870871
)
871872
scheduler.enter(sleeptime, 1, run_optimization_event, (sc,))
872-
873873
scheduler.enter(0, 1, run_optimization_event, (scheduler,))
874874
scheduler.run()
875875

0 commit comments

Comments
 (0)