fix: parse glance weather gust as float via gjson

toFloat erwartet eine Zahl, der HA-State kommt aber als String -> Template-
Fehler. Boee jetzt direkt per (.Subrequest "gust").JSON.Float "state" lesen,
gjson parst den numerischen String korrekt fuer den Schwellenvergleich.

Co-Authored-By: Claude Fable 5 <noreply@anthropic.com>
This commit is contained in:
2026-06-13 19:44:42 +02:00
parent 05b12c4802
commit 8200697258
+1 -1
View File
@@ -157,7 +157,7 @@
{{ $solar := (.Subrequest "solar").JSON.String "state" }} {{ $solar := (.Subrequest "solar").JSON.String "state" }}
{{ $uv := (.Subrequest "uv").JSON.String "state" }} {{ $uv := (.Subrequest "uv").JSON.String "state" }}
{{ $press := (.Subrequest "pressure").JSON.String "state" }} {{ $press := (.Subrequest "pressure").JSON.String "state" }}
{{ $gustF := toFloat $gust }} {{ $gustF := (.Subrequest "gust").JSON.Float "state" }}
{{ $divider := "border-left: 1px solid hsla(220, 40%, 70%, 0.14);" }} {{ $divider := "border-left: 1px solid hsla(220, 40%, 70%, 0.14);" }}
<div class="text-center" style="margin-bottom: 12px;"> <div class="text-center" style="margin-bottom: 12px;">
<div class="color-highlight size-h2" style="font-weight: 700;">{{ $temp }}°C</div> <div class="color-highlight size-h2" style="font-weight: 700;">{{ $temp }}°C</div>