mirror of
https://github.com/Akkudoktor-EOS/EOS.git
synced 2025-04-19 08:55:15 +00:00
* Currently prediction hours are relative from current hour and don't adjust on daylight saving change. * ist_dst_wechsel now unused.
This commit is contained in:
parent
fe9c8ecbbb
commit
e936aaf134
@ -2,6 +2,7 @@ import datetime
|
||||
import zoneinfo
|
||||
|
||||
|
||||
# currently unused
|
||||
def ist_dst_wechsel(tag: datetime.datetime, timezone="Europe/Berlin") -> bool:
|
||||
"""Checks if Daylight Saving Time (DST) starts or ends on a given day."""
|
||||
tz = zoneinfo.ZoneInfo(timezone)
|
||||
|
@ -1,12 +1,9 @@
|
||||
import datetime
|
||||
|
||||
# Set the backend for matplotlib to Agg
|
||||
import matplotlib
|
||||
import matplotlib.pyplot as plt
|
||||
import numpy as np
|
||||
from matplotlib.backends.backend_pdf import PdfPages
|
||||
|
||||
from akkudoktoreos.class_sommerzeit import ist_dst_wechsel
|
||||
from akkudoktoreos.config import AppConfig, SetupIncomplete
|
||||
|
||||
matplotlib.use("Agg")
|
||||
@ -100,11 +97,7 @@ def visualisiere_ergebnisse(
|
||||
#####################
|
||||
|
||||
plt.figure(figsize=(14, 10))
|
||||
|
||||
if ist_dst_wechsel(datetime.datetime.now()):
|
||||
hours = np.arange(start_hour, config.eos.prediction_hours - 1)
|
||||
else:
|
||||
hours = np.arange(start_hour, config.eos.prediction_hours)
|
||||
hours = np.arange(start_hour, config.eos.prediction_hours)
|
||||
|
||||
# Energy flow, grid feed-in, and grid consumption
|
||||
plt.subplot(3, 2, 1)
|
||||
@ -216,10 +209,7 @@ def visualisiere_ergebnisse(
|
||||
ax1.set_title("AC/DC Charging and Discharge Overview")
|
||||
ax1.grid(True)
|
||||
|
||||
if ist_dst_wechsel(datetime.datetime.now()):
|
||||
hours = np.arange(start_hour, config.eos.prediction_hours - 1)
|
||||
else:
|
||||
hours = np.arange(start_hour, config.eos.prediction_hours)
|
||||
hours = np.arange(start_hour, config.eos.prediction_hours)
|
||||
|
||||
pdf.savefig() # Save the current figure state to the PDF
|
||||
plt.close() # Close the current figure to free up memory
|
||||
|
Loading…
x
Reference in New Issue
Block a user