From: Siraaj Khandkar Date: Wed, 1 Aug 2018 02:54:53 +0000 (-0400) Subject: Add energy alert for <20% X-Git-Url: https://git.xandkar.net/?a=commitdiff_plain;h=361523eb88b8912410b5776d70edf9dfa7043fc8;p=khatus.git Add energy alert for <20% --- diff --git a/bin/khatus_controller b/bin/khatus_controller index 2b4fb07..411589d 100755 --- a/bin/khatus_controller +++ b/bin/khatus_controller @@ -145,6 +145,10 @@ function alert_check_energy( from, dbg, state, remaining, subj, body) { subj = "Energy_Low" body = sprintf("%d%% Get the charger.", remaining) alert_trigger_hi(from, subj, body) + } else if (remaining < 20) { + subj = "Energy_Low" + body = sprintf("%d%% Get the charger.", remaining) + alert_trigger_med(from, subj, body) } else if (remaining < 50) { if (!state__alerts__energy__notified_bellow_half) { state__alerts__energy__notified_bellow_half = 1