Go to the documentation of this file. 1 #ifndef TOTAL_LEAK_DETECTION_H
2 #define TOTAL_LEAK_DETECTION_H
56 void reset()
override;
60 const String getLogID()
const override;
67 const String
getRow(
int row)
const override;
189 #ifdef EMAIL_NOTIFICATION
196 void sendEmailLeakDetected()
override;
LeakDetectionConfig_t alarmConfig
alarm configuration for when there's nobody in the house
const String getRow(int row) const override
Returns the content of the row given as a parameter.
Type type
the type of the water leak detection algorithm
TotalLeakDetection(PulseCounter *pulseCounter, Type type, LeakDetectionConfig_t normalConfig, LeakDetectionConfig_t alarmConfig)
Constructor of the class.
HighLeakDetection * highLeakDetection
friend String HTML_resetLimitMinsAlarm(const TotalLeakDetection &totalLeakDetection)
Associated function for returing the reset time (mins) in the alarm configuration.
friend String HTML_detectedTime(const TotalLeakDetection &totalLeakDetection)
Associated function for returing the detection time of a total-water leak.
friend String HTML_detectionLimitAlarm(const TotalLeakDetection &totalLeakDetection)
Associated function for returing the limit (detection) in terms of the alarm configuration.
friend String HTML_resetLimitSecs(const TotalLeakDetection &totalLeakDetection)
Associated function for returing the reset time (secs) in the normal configuration.
friend String HTML_resetLimitHoursAlarm(const TotalLeakDetection &totalLeakDetection)
Associated function for returing the reset time (hours) in the alarm configuration.
friend String HTML_detected(const TotalLeakDetection &totalLeakDetection)
Associated function for returing information about a total-water leak being detected (1)
friend String HTML_activePercentage(const TotalLeakDetection &totalLeakDetection)
Associated function for returing the [%] information about how close a leak is from being detected.
friend String HTML_resetLimitDaysAlarm(const TotalLeakDetection &totalLeakDetection)
Associated function for returing the reset time (days) in the alarm configuration.
TotalLeakDetection * totalLeakDetection
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_detectedText(const TotalLeakDetection &totalLeakDetection)
Associated function for returing information about a total-water leak being detected (2)
unsigned long time_t
Referring to the data type unsigned long as time_t.
time_t startDayPulseTime
the start of the monoring period
friend String HTML_detectionLimit(const TotalLeakDetection &totalLeakDetection)
Associated function for returing the limit (detection) in terms of the normal configuration.
friend String HTML_resetLimitMins(const TotalLeakDetection &totalLeakDetection)
Associated function for returing the reset time (mins) in the normal configuration.
float getPercentLeakDetectionReset() const
Returns percentage information about how close a total-water leak is from being detected.
friend String HTML_resetLimitSecsAlarm(const TotalLeakDetection &totalLeakDetection)
Associated function for returing the reset time (secs) in the alarm configuration.
Type
The type of the water leak detection algorithm.
friend String HTML_bypass(const TotalLeakDetection &totalLeakDetection)
Associated function for returing information about the state of the bypass.
friend String HTML_resetLimitHours(const TotalLeakDetection &totalLeakDetection)
Associated function for returing the reset time (hours) in the normal configuration.
friend String HTML_resetLimitDays(const TotalLeakDetection &totalLeakDetection)
Associated function for returing the reset time (days) in the normal configuration.
void reset() override
Resets the algorithm.
void testActiveLeak() override
Tests if the total-water the algorithm should be reset if the current monitoring period is over.
void testResetLeak() override
Tests if a total-water leak has occurred, and if so, it will set the appropriate variables and flags.
friend String HTML_activePercentageColor(const TotalLeakDetection &totalLeakDetection)
Associated function for returing a color according to [%] information about how close a leak is from ...
PulseCounter * pulseCounter
instance of a pulse counter (input of the system)
friend String HTML_resetPercentage(const TotalLeakDetection &totalLeakDetection)
Associated function for returing the [%] information about how close the algorithm is from being rese...
LeakDetectionConfig_t normalConfig
normal configuarion for when the house is occupied
std::map< int, String(*)(const TotalLeakDetection &highLeakDetection)> htmlData
A map of different values (keys) and their associated functions which returns the appropriate values.
~TotalLeakDetection()
Descrutor of the class.