aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorDennis Eriksen <d@ennis.no>2024-10-11 14:23:43 +0200
committerDennis Eriksen <d@ennis.no>2024-10-11 14:23:43 +0200
commit1b2f57041a59a77f31ded55496f8918982a1a1b9 (patch)
tree8f61e55c69edbd6abf140aba462bf535c83e1f22
parentlist moved (diff)
downloadenergyscripts-1b2f57041a59a77f31ded55496f8918982a1a1b9.tar.gz
revert bb0c094
Apparently the list moved *again*...
-rw-r--r--scripts/entsoe.py8
1 files changed, 4 insertions, 4 deletions
diff --git a/scripts/entsoe.py b/scripts/entsoe.py
index 9c721a2..1836229 100644
--- a/scripts/entsoe.py
+++ b/scripts/entsoe.py
@@ -78,15 +78,15 @@ for area in areas:
items = 0
if "Publication_MarketDocument" in data_dict:
- for lista in data_dict["Publication_MarketDocument"]["TimeSeries"]["Period"]:
+ for lista in data_dict["Publication_MarketDocument"]["TimeSeries"]:
utctime = datetime.strptime(
- lista["timeInterval"]["start"], "%Y-%m-%dT%H:%MZ"
+ lista["Period"]["timeInterval"]["start"], "%Y-%m-%dT%H:%MZ"
)
utctime = utctime.replace(tzinfo=UTC)
cettime = utctime.astimezone(CET)
- items += len(lista["Point"])
+ items += len(lista["Period"]["Point"])
- for item in lista["Point"]:
+ for item in lista["Period"]["Point"]:
# the response contains timerange, but not timestamp for every price, so we must calculate it
time = str(cettime + timedelta(hours=int(item["position"]) - 1))