From: Siraaj Khandkar Date: Wed, 8 Aug 2018 14:06:08 +0000 (-0400) Subject: Fix weather alerts with empty phenomena X-Git-Url: https://git.xandkar.net/?a=commitdiff_plain;h=3fc7fe2c8c717bee50010994176fd1e99f12d703;p=khatus.git Fix weather alerts with empty phenomena --- diff --git a/bin/khatus_controller b/bin/khatus_controller index 587e37c..da1c84d 100755 --- a/bin/khatus_controller +++ b/bin/khatus_controller @@ -141,12 +141,12 @@ 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/\ diff --git a/bin/khatus_parse_metar_d_output b/bin/khatus_parse_metar_d_output index 760ecd9..b228390 100755 --- a/bin/khatus_parse_metar_d_output +++ b/bin/khatus_parse_metar_d_output @@ -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 + } } } }