Esios: extend forecast range (#28326)
This commit is contained in:
parent
a70a14001d
commit
40af84f87b
1 changed files with 7 additions and 8 deletions
|
|
@ -26,9 +26,7 @@ params:
|
|||
required: true
|
||||
- name: region
|
||||
description:
|
||||
generic: "Retrieve 1 out of 5 regions from the API."
|
||||
help:
|
||||
en: Península, Canarias, Baleares, Ceuta, Melilla
|
||||
generic: "Region"
|
||||
example: Península
|
||||
type: choice
|
||||
choice: ["Península", "Canarias", "Baleares", "Ceuta", "Melilla"]
|
||||
|
|
@ -39,13 +37,14 @@ render: |
|
|||
{{ include "tariff-base" . }}
|
||||
forecast:
|
||||
source: http
|
||||
uri: https://api.esios.ree.es/indicators/{{.indicator}}
|
||||
auth:
|
||||
type: bearer
|
||||
token: {{ .securitytoken }}
|
||||
uri: https://api.esios.ree.es/indicators/{{ .indicator }}?start_date={{ now | date "2006-01-02" }}T00:00&end_date={{ (now.AddDate 0 0 1) | date "2006-01-02" }}T23:59
|
||||
method: GET
|
||||
headers:
|
||||
x-api-key: "{{ .securitytoken }}"
|
||||
Accept: "application/json"
|
||||
jq: |
|
||||
[.indicator.values[]
|
||||
| select(.geo_name == "{{.region}}")
|
||||
| select(.geo_name == {{ if eq .indicator "1739" }} "España" {{ else }}"{{.region}}"{{ end }})
|
||||
| {
|
||||
start: .datetime_utc,
|
||||
end: (.datetime_utc | strptime ("%FT%TZ") | mktime + 3600 | strftime("%FT%TZ")),
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue