Implementato eventi events/ev_not_open_for_rain, events/ev_not_open_for_rain_sensor, events/ev_not_open_for_rain_online. Aggiornato script di invio mail notifiche

This commit is contained in:
lejubila
2018-05-03 11:45:47 +02:00
parent 5c00853e39
commit 78fa176848
5 changed files with 23 additions and 0 deletions

View File

@@ -93,6 +93,8 @@ function ev_open {
local dif=0
let "dif = now - last_rain"
if [ $dif -lt $NOT_IRRIGATE_IF_RAIN_ONLINE ]; then
trigger_event "ev_not_open_for_rain_online" "$1" "$2"
trigger_event "ev_not_open_for_rain" "$1" "$2"
log_write "Solenoid '$1' not open for rain (online check)"
message_write "warning" "Solenoid not open for rain"
return
@@ -106,6 +108,8 @@ function ev_open {
local dif=0
let "dif = now - last_rain"
if [ $dif -lt $NOT_IRRIGATE_IF_RAIN_SENSOR ]; then
trigger_event "ev_not_open_for_rain_sensor" "$1" "$2"
trigger_event "ev_not_open_for_rain" "$1" "$2"
log_write "Solenoid '$1' not open for rain (sensor check)"
message_write "warning" "Solenoid not open for rain"
return