From 4e778a2cd22cc95fae617fbca34cb2113f04c159 Mon Sep 17 00:00:00 2001 From: andig Date: Mon, 2 Dec 2024 09:06:43 +0100 Subject: [PATCH] chore: simplify --- templates/definition/tariff/allinpower.yaml | 7 ++++++- 1 file changed, 6 insertions(+), 1 deletion(-) diff --git a/templates/definition/tariff/allinpower.yaml b/templates/definition/tariff/allinpower.yaml index 9309c15c0..5d34b7daa 100644 --- a/templates/definition/tariff/allinpower.yaml +++ b/templates/definition/tariff/allinpower.yaml @@ -15,4 +15,9 @@ render: | forecast: source: http uri: https://api.allinpower.nl/troodon/api/p/spot_market/prices/?product_type=ELK - jq: '[.timestamps, .prices] | transpose | map({ "start": (.[0] | strptime("%Y-%m-%dT%H:%M:%S.%f%z") | strftime("%Y-%m-%dT%H:%M:%SZ")), "end": (.[0] | strptime("%Y-%m-%dT%H:%M:%S.%f%z") | mktime + 3600 | strftime("%Y-%m-%dT%H:%M:%SZ")), "price": .[1] }) | tostring' + jq: | + [.timestamps, .prices] | transpose | map({ + "start": (.[0] | strptime("%FT%T.%f%z") | strftime("%FT%TZ")), + "end": (.[0] | strptime("%FT%T.%f%z") | mktime + 3600 | strftime("%FT%TZ")), + "price": .[1] + }) | tostring'