Fix weather alerts with empty phenomena
authorSiraaj Khandkar <siraaj@khandkar.net>
Wed, 8 Aug 2018 14:06:08 +0000 (10:06 -0400)
committerSiraaj Khandkar <siraaj@khandkar.net>
Wed, 8 Aug 2018 14:06:08 +0000 (10:06 -0400)
bin/khatus_controller
bin/khatus_parse_metar_d_output

index 587e37c..da1c84d 100755 (executable)
     db["weather_temperature"] = $0
 }
 
-/^OK in:WEATHER phenomena/\
+/^OK in:WEATHER phenomenon/\
 {
     shift()
     shift()
     shift()
-    alert_trigger_low("weather_phenomena", "WeatherPhenomena", $0)
+    alert_trigger_low("weather_phenomenon", "WeatherPhenomenon", $0)
 }
 
 /^OK in:DATE_TIME/\
index 760ecd9..b228390 100755 (executable)
@@ -38,7 +38,10 @@ END {
         temp_fahrenheit = (temp_celsius * (9 / 5)) + 32
         print "temperature " temp_fahrenheit "°F"
         for (i=first["Phenomena"]; i<=last["Phenomena"]; i++) {
-            print "phenomena " values[i]
+            phenomenon = values[i]
+            if (phenomenon) {
+                print "phenomenon " phenomenon
+            }
         }
     }
 }
This page took 0.027553 seconds and 4 git commands to generate.