Skip to content

Commit 3895548

Browse files
authored
fix rabot (#3146)
1 parent 48d029a commit 3895548

1 file changed

Lines changed: 2 additions & 2 deletions

File tree

  • packages/modules/electricity_pricing/flexible_tariffs/rabot

packages/modules/electricity_pricing/flexible_tariffs/rabot/tariff.py

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -17,10 +17,10 @@ def fetch(config: RabotTariff) -> None:
1717
f"/contracts/{config.configuration.contract_number}/metrics",
1818
timeout=15
1919
).json()["data"]["records"]
20-
prices: Dict[int, float] = {}
21-
if len(prices) == 0:
20+
if len(raw_prices) == 0:
2221
raise Exception("Es konnten keine Preise vom Rabot-Server abgerufen werden. Bitte prüfe, ob dein Konto mit"
2322
" einem dynamischen Stromvertrag verknüpft ist.")
23+
prices: Dict[int, float] = {}
2424
for data in raw_prices:
2525
formatted_price = data["value"] / 100000 # ct/kWh -> €/Wh
2626
timestamp = datetime.datetime.strptime(data["moment"], "%Y-%m-%d %H:%M").timestamp()

0 commit comments

Comments
 (0)