[SYS][BREAKING] Add gateway states, Offline mode and refactor sleep (#2020)

Gaterway states to improve LED management
Make the sleep function accessible outside BT
BREAKING remove sleep for ESP8266
BREAKING lowpowermode API changed to powermode and new mode definition

Co-authored-by: Florian <1technophile@users.noreply.github.com>
This commit is contained in:
FlorianandFlorian authored and GitHub committed 2024-08-23 16:55:04 -05:00
1 parent 068c2e457a
commit f9a5c6961a
16 files changed
+367 -443

No files matched your search

+4 -5
View File
@@ -68,11 +68,10 @@ void MeasureC37_YL83_HMRDWater() {
if (C37_YL83_HMRDdata.size() > 0) {
C37_YL83_HMRDdata["origin"] = C37_YL83_HMRD_TOPIC;
handleJsonEnqueue(C37_YL83_HMRDdata);
delay(10);
# if defined(DEEP_SLEEP_IN_US) || defined(ESP32_EXT0_WAKE_PIN)
if (sensorDigitalValue == 1) //No water detected, all good we can sleep
ready_to_sleep = true;
# endif
if (sensorDigitalValue == 1) { //No water detected, all good we can sleep
if (SYSConfig.powerMode > 0)
ready_to_sleep = true;
}
}
persistedanalog = sensorAnalogValue;
persisteddigital = sensorDigitalValue;