Skip to content

Commit 7d331f9

Browse files
committed
add ToDos for rabot and voltego
1 parent 88e5ff8 commit 7d331f9

File tree

2 files changed

+3
-0
lines changed

2 files changed

+3
-0
lines changed

packages/modules/electricity_tariffs/rabot/tariff.py

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -56,6 +56,7 @@ def get_raw_prices():
5656
).json()["records"]
5757

5858
validate_token(config)
59+
# ToDo: get rid of hard coded timezone!
5960
# start_date von voller Stunde sonst liefert die API die nächste Stunde
6061
start_date = datetime.datetime.fromtimestamp(
6162
timecheck.create_unix_timestamp_current_full_hour()).astimezone(

packages/modules/electricity_tariffs/voltego/tariff.py

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -52,6 +52,7 @@ def get_raw_prices():
5252
).json()["elements"]
5353

5454
validate_token(config)
55+
# ToDo: get rid of hard coded timezone! Check supported time formats by Voltego API
5556
# start_date von voller Stunde sonst liefert die API die nächste Stunde
5657
start_date = datetime.datetime.fromtimestamp(
5758
timecheck.create_unix_timestamp_current_full_hour()).astimezone(
@@ -73,6 +74,7 @@ def get_raw_prices():
7374
prices: Dict[int, float] = {}
7475
for data in raw_prices:
7576
formatted_price = data["price"]/1000000 # €/MWh -> €/Wh
77+
# timezone of the result should already be UTC as epoch does not support timezones
7678
timestamp = datetime.datetime.fromisoformat(data["begin"]).astimezone(
7779
pytz.timezone("Europe/Berlin")).timestamp()
7880
prices.update({int(timestamp): formatted_price})

0 commit comments

Comments
 (0)