File tree Expand file tree Collapse file tree 2 files changed +3
-0
lines changed
packages/modules/electricity_tariffs Expand file tree Collapse file tree 2 files changed +3
-0
lines changed Original file line number Diff line number Diff line change @@ -56,6 +56,7 @@ def get_raw_prices():
56
56
).json ()["records" ]
57
57
58
58
validate_token (config )
59
+ # ToDo: get rid of hard coded timezone!
59
60
# start_date von voller Stunde sonst liefert die API die nächste Stunde
60
61
start_date = datetime .datetime .fromtimestamp (
61
62
timecheck .create_unix_timestamp_current_full_hour ()).astimezone (
Original file line number Diff line number Diff line change @@ -52,6 +52,7 @@ def get_raw_prices():
52
52
).json ()["elements" ]
53
53
54
54
validate_token (config )
55
+ # ToDo: get rid of hard coded timezone! Check supported time formats by Voltego API
55
56
# start_date von voller Stunde sonst liefert die API die nächste Stunde
56
57
start_date = datetime .datetime .fromtimestamp (
57
58
timecheck .create_unix_timestamp_current_full_hour ()).astimezone (
@@ -73,6 +74,7 @@ def get_raw_prices():
73
74
prices : Dict [int , float ] = {}
74
75
for data in raw_prices :
75
76
formatted_price = data ["price" ]/ 1000000 # €/MWh -> €/Wh
77
+ # timezone of the result should already be UTC as epoch does not support timezones
76
78
timestamp = datetime .datetime .fromisoformat (data ["begin" ]).astimezone (
77
79
pytz .timezone ("Europe/Berlin" )).timestamp ()
78
80
prices .update ({int (timestamp ): formatted_price })
You can’t perform that action at this time.
0 commit comments