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:
4
events/ev_not_open_for_rain/.gitignore
vendored
Normal file
4
events/ev_not_open_for_rain/.gitignore
vendored
Normal file
@@ -0,0 +1,4 @@
|
||||
# Ignore everything in this directory
|
||||
*
|
||||
# Except this file
|
||||
!.gitignore
|
||||
4
events/ev_not_open_for_rain_online/.gitignore
vendored
Normal file
4
events/ev_not_open_for_rain_online/.gitignore
vendored
Normal file
@@ -0,0 +1,4 @@
|
||||
# Ignore everything in this directory
|
||||
*
|
||||
# Except this file
|
||||
!.gitignore
|
||||
4
events/ev_not_open_for_rain_sensor/.gitignore
vendored
Normal file
4
events/ev_not_open_for_rain_sensor/.gitignore
vendored
Normal file
@@ -0,0 +1,4 @@
|
||||
# Ignore everything in this directory
|
||||
*
|
||||
# Except this file
|
||||
!.gitignore
|
||||
@@ -65,6 +65,13 @@ case "$EVENT" in
|
||||
BODY="PiGarden triggered new event\n\nEVENT: $EVENT\nZONE: $ALIAS\nTIME: $(/bin/date -d@$TIME)"
|
||||
;;
|
||||
|
||||
"ev_not_open_for_rain" | "ev_not_open_for_rain_online" | "ev_not_open_for_rain_sensor")
|
||||
ALIAS="$2"
|
||||
FORCE="$3"
|
||||
TIME=$4
|
||||
BODY="PiGarden triggered new event\n\nEVENT: $EVENT\nZONE: $ALIAS\nFORCED IRRIGATION: $FORCE\nTIME: $(/bin/date -d@$TIME)"
|
||||
;;
|
||||
|
||||
"check_rain_sensor_before" | "check_rain_sensor_after" | "check_rain_sensor_change")
|
||||
STATE="$2"
|
||||
TIME=$3
|
||||
|
||||
@@ -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
|
||||
|
||||
Reference in New Issue
Block a user