Go to the documentation of this file. 1 #ifndef LOW_LEAK_DETECTION_H
2 #define LOW_LEAK_DETECTION_H
57 void reset()
override;
88 const String getLogDescription()
const override;
92 const String getLogID()
const override;
97 const String
getRow(
int row)
const override;
249 #ifdef EMAIL_NOTIFICATION
256 void sendEmailLeakDetected();
LeakDetectionConfig_t alarmConfig
alarm configuration for when there's nobody in the house
LowLeakDetection(PulseCounter *pulseCounter, Type type, LeakDetectionConfig_t normalConfig, LeakDetectionConfig_t alarmConfig)
Constructor of the class.
int flipFlop
state of the flip-flop (1/0)
friend String HTML_resetLimitDaysAlarm(const LowLeakDetection &lowLeakDetection)
Associated function for returing the reset time (days) in the alarm configuration.
String getFormatOfSettingsToSave() override
Returns the current settings of the algorithm.
LowLeakDetection * lowLeakDetection
Type type
the type of the water leak detection algorithm
friend String HTML_detectedLimitDays(const LowLeakDetection &lowLeakDetection)
Associated function for returing the limit action time (days) in terms of the normal configuration.
std::map< int, String(*)(const LowLeakDetection &highLeakDetection)> htmlData
A map of different values (keys) and their associated functions which returns the appropriate values.
friend String HTML_resetPercentage(const LowLeakDetection &lowLeakDetection)
Associated function for returing the [%] information about how close the algorithm is from being rese...
HighLeakDetection * highLeakDetection
void reset() override
Resets the algorithm.
friend String HTML_detectedLimitSecsAlarm(const LowLeakDetection &lowLeakDetection)
Associated function for returing the limit action time (secs) in terms of the alarm configuration.
time_t flipFlopSetTime
time when the flip-flop has been set to 1
friend String HTML_resetLimitSecsAlarm(const LowLeakDetection &lowLeakDetection)
Associated function for returing the reset time (secs) in the alarm configuration.
friend String HTML_resetLimitHours(const LowLeakDetection &lowLeakDetection)
Associated function for returing the reset time (hours) in the normal configuration.
friend String HTML_detectedLimitSecs(const LowLeakDetection &lowLeakDetection)
Associated function for returing the limit action time (secs) in terms of the normal configuration.
~LowLeakDetection()
Descrutor of the class.
friend String HTML_detectedLimitMinsAlarm(const LowLeakDetection &lowLeakDetection)
Associated function for returing the limit action time (mins) in terms of the alarm configuration.
friend String HTML_resetLimitDays(const LowLeakDetection &lowLeakDetection)
Associated function for returing the reset time (days) in the normal configuration.
friend String HTML_activePercentageColor(const LowLeakDetection &lowLeakDetection)
Associated function for returing a color according to [%] information about how close a leak is from ...
friend String HTML_detected(const LowLeakDetection &lowLeakDetection)
Associated function for returing information about a low-water leak being detected (1)
friend String HTML_resetLimitMins(const LowLeakDetection &lowLeakDetection)
Associated function for returing the reset time (mins) in the normal configuration.
float getPercentLeakDetectionReset() const
Returns percentage information about how close a low-water leak is from being detected.
const String getRow(int row) const override
Returns the content of the row given as a parameter.
void update() override
Updates the algorithm.
friend String HTML_detectedLimitHoursAlarm(const LowLeakDetection &lowLeakDetection)
Associated function for returing the limit action time (hours) in terms of the alarm configuration.
unsigned long time_t
Referring to the data type unsigned long as time_t.
friend String HTML_detectedLimitDaysAlarm(const LowLeakDetection &lowLeakDetection)
Associated function for returing the limit action time (days) in terms of the alarm configuration.
float getPercentLeakDetected() const
Returns percentage information about how close the algorithm is from being reset.
const String getHTMLData(const int id) const override
Since this class is registered as a source of data for the HTML content, it needs return the appropri...
friend String HTML_resetLimitHoursAlarm(const LowLeakDetection &lowLeakDetection)
Associated function for returing the reset time (hours) in the alarm configuration.
Type
The type of the water leak detection algorithm.
friend String HTML_bypass(const LowLeakDetection &lowLeakDetection)
Associated function for returing information about the state of the bypass.
void testActiveLeak() override
Tests if a low-water leak has occurred, and if so, it will set the appropriate variables and flags.
friend String HTML_resetLimitMinsAlarm(const LowLeakDetection &lowLeakDetection)
Associated function for returing the reset time (mins) in the alarm configuration.
friend String HTML_detectedLimitHours(const LowLeakDetection &lowLeakDetection)
Associated function for returing the limit action time (hours) in terms of the normal configuration.
void testResetLeak() override
Tests if the low-water the algorithm should be reset based on inactivity of pulse on the input pin.
friend String HTML_detectedTime(const LowLeakDetection &lowLeakDetection)
Associated function for returing the detection time of a low-water leak.
PulseCounter * pulseCounter
instance of a pulse counter (input of the system)
friend String HTML_detectedText(const LowLeakDetection &lowLeakDetection)
Associated function for returing information about a low-water leak being detected (2)
friend String HTML_detectedLimitMins(const LowLeakDetection &lowLeakDetection)
Associated function for returing the limit action time (mins) in terms of the normal configuration.
LeakDetectionConfig_t normalConfig
normal configuarion for when the house is occupied
friend String HTML_activePercentage(const LowLeakDetection &lowLeakDetection)
Associated function for returing the [%] information about how close a leak is from being detected.
friend String HTML_resetLimitSecs(const LowLeakDetection &lowLeakDetection)
Associated function for returing the reset time (secs) in the normal configuration.