From 2dc9761809ad7ebb23c81a6cffe13240930177db Mon Sep 17 00:00:00 2001 From: kisfenyo Date: Wed, 14 Jan 2026 15:51:33 +0100 Subject: [PATCH] fixed? --- glance-system/glance-kisfenyo.yaml | 60 +++++++++++++++--------------- 1 file changed, 31 insertions(+), 29 deletions(-) diff --git a/glance-system/glance-kisfenyo.yaml b/glance-system/glance-kisfenyo.yaml index cec472d..25a492f 100644 --- a/glance-system/glance-kisfenyo.yaml +++ b/glance-system/glance-kisfenyo.yaml @@ -374,7 +374,6 @@ data: {{ if .JSON.Exists "error" }} @@ -440,40 +438,44 @@ data: Place: {{ .JSON.String "place" }} {{ else }} - {{ $c := .JSON "current" }} - {{ $hourly := .JSON.Array "hourly" }} - {{ $daily := .JSON.Array "daily" }} - {{ $src := .JSON "source" }} -
- {{ if $c.Exists "icon_url" }}{{ end }} + {{ if .JSON.Exists "current.icon_url" }}{{ end }}
-
{{ $c.Float "temp_c" | toInt }}°C
-
{{ $c.String "condition_hu" }}
+ {{ if .JSON.Exists "current.temp_c" }} +
{{ .JSON.Float "current.temp_c" | toInt }}°C
+ {{ else }} +
+ {{ end }} +
{{ .JSON.String "current.condition_hu" }}
{{ .JSON.String "place" }}
-
- {{ range $hourly }} -
-
{{ .String "hour" }}
- {{ if .Exists "icon_url" }}{{ end }} -
{{ .Float "temp_c" | toInt }}°
- {{ if .Exists "precip_pct" }} -
{{ .Float "precip_pct" | toInt }}%
- {{ else }} -
 
- {{ end }} -
- {{ end }} -
+ {{ $hourly := .JSON.Array "hourly" }} + {{ if gt (len $hourly) 0 }} +
+ {{ range $hourly }} +
+
{{ .String "hour" }}
+ {{ if .Exists "icon_url" }}{{ end }} + {{ if .Exists "temp_c" }}
{{ .Float "temp_c" | toInt }}°
{{ else }}
{{ end }} + {{ if .Exists "precip_pct" }} +
{{ .Float "precip_pct" | toInt }}%
+ {{ else }} +
 
+ {{ end }} +
+ {{ end }} +
+ {{ else }} +
No hourly data returned by scraper yet.
+ {{ end }}
- {{ range $daily }} + {{ range .JSON.Array "daily" }}
{{ .String "dow" }}
{{ if .Exists "icon_url" }}{{ end }} @@ -485,8 +487,8 @@ data: {{ end }}
-
{{ .Float "tmin_c" | toInt }}°
-
{{ .Float "tmax_c" | toInt }}°
+ {{ if .Exists "tmin_c" }}
{{ .Float "tmin_c" | toInt }}°
{{ else }}
{{ end }} + {{ if .Exists "tmax_c" }}
{{ .Float "tmax_c" | toInt }}°
{{ else }}
{{ end }} {{ if .Exists "prec_mm" }}
{{ .Float "prec_mm" }}mm
{{ end }}
@@ -494,7 +496,7 @@ data:
- Forrás: {{ $src.String "name" }} + Forrás: {{ .JSON.String "source.name" }}
{{ end }}