changeset 489:120eb7eb7398

fetch_weather, weather: Fixes/adjustments to the previous changes.
author Matti Hamalainen <ccr@tnsp.org>
date Tue, 21 Jan 2020 22:34:15 +0200
parents 39fe08aafe12
children 0d6dfcc1c957
files config.weather.example fetch_weather.pl weather.tcl
diffstat 3 files changed, 7 insertions(+), 5 deletions(-) [+]
line wrap: on
line diff
--- a/config.weather.example	Tue Jan 21 22:16:49 2020 +0200
+++ b/config.weather.example	Tue Jan 21 22:34:15 2020 +0200
@@ -39,12 +39,12 @@
 
 
 set weather_msg_result [list "\002@station@\002, mitattu klo @ctime@: \002@temp@°C\002"]
-lappend weather_msg_result ", tien pinta @rv_10@°C"
+lappend weather_msg_result ", tien pinta @rv_2@°C"
 lappend weather_msg_result ", kosteus \002@humidity@%\002"
 lappend weather_msg_result ", tuuli \002@wind_speed@\002 m/s"
 lappend weather_msg_result " (suunta \002@wind_direction@\002)"
-lappend weather_msg_result ", pilvipeite \002@rv_9@\002"
-lappend weather_msg_result ", näkyvyys \002@rv_12@ km\002"
+lappend weather_msg_result ", pilvipeite \002@rv_1@\002"
+lappend weather_msg_result ", näkyvyys \002@rv_4@ km\002"
 lappend weather_msg_result "."
 
 
--- a/fetch_weather.pl	Tue Jan 21 22:16:49 2020 +0200
+++ b/fetch_weather.pl	Tue Jan 21 22:34:15 2020 +0200
@@ -462,7 +462,7 @@
             plonk_data($wdata->{"sensors"}->{"winddirection"}->{"sensorValue"}),
 
             # Station type dependant data
-            "",
+            "", # unused for station type 1
             plonk_data($wdata->{"sensors"}->{"roadsurfacetemperature1"}->{"sensorValue"}),
             plonk_data($wdata->{"sensors"}->{"precipitation"}->{"sensorValueDescriptionFi"}),
             plonk_data($wdata->{"sensors"}->{"visibility"}->{"sensorValue"}),
--- a/weather.tcl	Tue Jan 21 22:16:49 2020 +0200
+++ b/weather.tcl	Tue Jan 21 22:34:15 2020 +0200
@@ -148,8 +148,10 @@
     set uvals(ctime) [clock format $uvals(vtime) -format "%H:%M (%d.%m.%Y)"]
   }
 
+  set mid 1
   for {set id 10} {$id < [llength $udata]} {incr id} {
-    set uvals(rv_$id) [lindex $udata $id]
+    set uvals(rv_$mid) [lindex $udata $id]
+    incr mid
   }
 
   set astr ""