home
/
code
/
khatus.git
/ blobdiff
commit
grep
author
committer
pickaxe
?
search:
re
summary
|
shortlog
|
log
|
commit
|
commitdiff
|
tree
raw
|
inline
| side by side
Fix weather alerts with empty phenomena
[khatus.git]
/
bin
/
khatus_controller
diff --git
a/bin/khatus_controller
b/bin/khatus_controller
index
c56370e
..
da1c84d
100755
(executable)
--- a/
bin/khatus_controller
+++ b/
bin/khatus_controller
@@
-97,7
+97,7
@@
{
shift()
shift()
{
shift()
shift()
- db["net_wifi_status"] = $0
+ set_net_wifi_status()
}
/^OK in:BLUETOOTH_POWER/\
}
/^OK in:BLUETOOTH_POWER/\
@@
-133,13
+133,22
@@
db["mpd_status_percent"] = $3
}
db["mpd_status_percent"] = $3
}
-/^OK in:WEATHER/\
+/^OK in:WEATHER
temperature
/\
{
{
+ shift()
shift()
shift()
db["weather_temperature"] = $0
}
shift()
shift()
db["weather_temperature"] = $0
}
+/^OK in:WEATHER phenomenon/\
+{
+ shift()
+ shift()
+ shift()
+ alert_trigger_low("weather_phenomenon", "WeatherPhenomenon", $0)
+}
+
/^OK in:DATE_TIME/\
{
shift()
/^OK in:DATE_TIME/\
{
shift()
@@
-213,7
+222,7
@@
function alert_check_mpd( curr, prev, name, body) {
" - " db_mpd_song["Album:"] \
" - " db_mpd_song["Title:"]
}
" - " db_mpd_song["Album:"] \
" - " db_mpd_song["Title:"]
}
- alert_trigger_low("alert_check_mpd", "NowPlaying", body)
+ alert_trigger_low("alert_check_mpd", "
Mpd
NowPlaying", body)
}
}
}
}
@@
-338,6
+347,12
@@
function set_disk_io( curr_w, curr_r, prev_w, prev_r) {
db["disk_io_diff_r"] = curr_r - prev_r
}
db["disk_io_diff_r"] = curr_r - prev_r
}
+function set_net_wifi_status( interface) {
+ interface = $1
+ shift()
+ db["net_wifi_status", interface] = $0
+}
+
function set_net_addr_io( \
interface, address, io_curr_w, io_curr_r, io_prev_w, io_prev_r\
) {
function set_net_addr_io( \
interface, address, io_curr_w, io_curr_r, io_prev_w, io_prev_r\
) {
@@
-475,7
+490,7
@@
function make_status_net( \
io_stat = "--"
}
if (interface ~ "^w") {
io_stat = "--"
}
if (interface ~ "^w") {
- label = label ":" db["net_wifi_status"]
+ label = label ":" db["net_wifi_status"
, interface
]
}
if (++count_printed > 1) {
sep = " "
}
if (++count_printed > 1) {
sep = " "
This page took
0.024306 seconds
and
4
git commands to generate.