From 02e502a89468088852e4bf0dcdf893ac4e23732f Mon Sep 17 00:00:00 2001 From: andig Date: Sat, 7 Dec 2024 19:01:26 +0100 Subject: [PATCH] chore: simplify (#17641) --- templates/definition/tariff/energy-charts-api.yaml | 9 +++++++-- 1 file changed, 7 insertions(+), 2 deletions(-) diff --git a/templates/definition/tariff/energy-charts-api.yaml b/templates/definition/tariff/energy-charts-api.yaml index f15fe6c495..a60382232f 100644 --- a/templates/definition/tariff/energy-charts-api.yaml +++ b/templates/definition/tariff/energy-charts-api.yaml @@ -40,5 +40,10 @@ render: | {{ include "tariff-base" . }} forecast: source: http - uri: https://api.energy-charts.info/price?bzn={{ .bzn }}&end={{"{{"}} now | dateModify "+24h" | date "2006-01-02" {{"}}"}} - jq: '[.unix_seconds, .price] | transpose | map({ "start": (.[0] | todate), "end": ((.[0]+3600) | todate), "price": (.[1]/1000)}) | tostring' + uri: https://api.energy-charts.info/price?bzn={{ .bzn }}&end={{ `{{ addDate now 0 0 1 | date "2006-01-02" }}` }} + jq: | + [.unix_seconds, .price] | transpose | map({ + "start": .[0] | todate, + "end": .[0]+3600 | todate, + "price": .[1]/1000 + }) | tostring