Go to the documentation of this file.
37 #ifdef EMAIL_NOTIFICATION
45 #ifdef EMAIL_NOTIFICATION
65 #ifdef EMAIL_NOTIFICATION
78 #ifdef EMAIL_NOTIFICATION
86 case High:
return "High";
87 case Low:
return "Low";
88 case Total:
return "Total";
97 #ifdef EMAIL_NOTIFICATION
101 data +=
"current settings:\r\n";
104 data +=
"new settings:\r\n";
109 data +=
"current settings:\r\n";
112 data +=
"new settings:\r\n";
117 subject +=
" leak detection settings ";
119 subject += alarm ?
"(ALARM)" :
"(NORMAL)";
@ CHANGED_SETTINGS
when the user changes settings
LeakDetectionConfig_t alarmConfig
alarm configuration for when there's nobody in the house
@ Total
total water leak detection algorithm
int requestUpdateAlarmConfig
flag if the new alarms config should be applied
void changeStateOfHomeAlarm(bool state)
Changes the state of the home alarm.
Type type
the type of the water leak detection algorithm
#define FORMAT_TIME(time)
Converts a time in milliseconds into a formatted string.
String getType() const
Returns the type of the water leak detection algorithm.
PulseCounter pulseCounter(SENSOR_PIN)
@ Low
low water leak detection algorithm
Type
different types of e-mail that can be sent to the user
time_t limitResetTime
limit reset time e.g. 5 mins, 24h, ....
int limitPulseAction
limit action in pulses
LeakDetectionConfig_t * config
pointer to the current configuration
void updateAlarmConfig(LeakDetectionConfig_t newAlarmConfig)
Updates the alarm settings.
@ High
high water leak detection algorithm
void updateNormalConfig(LeakDetectionConfig_t newNormalConfig)
Updates the normal settings.
void applyNewConfig()
Applies the new config configuration.
time_t limitActionTime
limit action time (leak has been detected)
int stateOfHomeAlarm
the current state of the home alarm
LeakDetectionConfig_t newNormalConfig
new parameters of the normal config when the user changes them
#define PULSE_TO_LITER(p)
Converts pulses to liters.
LeakDetectionConfig_t getAlarmConfig()
Returns the current alarm config.
Type
The type of the water leak detection algorithm.
byte sendEmail(String subject, String data)
Sends an e-mail off to the smtp2go server.
@ APPLIED_NEW_SETTING
when the new settings are applied
LeakDetectionConfig_t newAlarmConfig
new parameters of the alarm config when the user changes them
int oldBypassValue
old bypass value (used for sending e-mails)
LeakDetectionConfig_t getNormalConfig()
Returns the current normal config.
PulseCounter * pulseCounter
instance of a pulse counter (input of the system)
int requestUpdateNormalConfig
flag if the new normal config should be applied
LeakDetectionConfig_t normalConfig
normal configuarion for when the house is occupied
ALeakDetectable(PulseCounter *pulseCounter, Type type, LeakDetectionConfig_t normalConfig, LeakDetectionConfig_t alarmConfig)
Constructor of the class.
static EmailSender * getInstance()
Returns the instance of the class.