Status LED for flashing

This commit is contained in:
c3ma 2020-10-21 16:57:57 +02:00
parent 9b27df7172
commit 04cb8bbaf0

View File

@ -147,6 +147,7 @@ void mode2MQTT(){
float temp[2] = { TEMP_INIT_VALUE, TEMP_INIT_VALUE };
float* pFloat = temp;
int devices = dallas.readAllTemperatures(pFloat, 2);
if (devices < 2) {
if ((pFloat[0] > TEMP_INIT_VALUE) && (pFloat[0] < TEMP_MAX_VALUE) ) {
sensorTemp.setProperty("control").send( String(pFloat[0]));
@ -270,7 +271,6 @@ void readSensors() {
}
}
Serial << "DS18B20" << endl;
/* Read the temperature sensors once, as first time 85 degree is returned */
Serial << "DS18B20" << String(dallas.readDevices()) << endl;
delay(200);
@ -322,9 +322,7 @@ void onHomieEvent(const HomieEvent& event) {
//wait for rtc sync?
rtcDeepSleepTime = deepSleepTime.get();
if(!mode3Active){
mode2MQTT();
}
Homie.getLogger() << "MQTT 1" << endl;
break;
case HomieEventType::READY_TO_SLEEP:
@ -332,11 +330,11 @@ void onHomieEvent(const HomieEvent& event) {
esp_deep_sleep_start();
break;
case HomieEventType::OTA_STARTED:
Serial.println("OTA DS Disabled");
digitalWrite(OUTPUT_SENSOR, HIGH);
mode3Active=true;
break;
case HomieEventType::OTA_SUCCESSFUL:
Serial.println("OTA DS reenabled");
digitalWrite(OUTPUT_SENSOR, LOW);
mode3Active=false;
break;
default:
@ -699,9 +697,6 @@ void setup() {
void loop() {
Homie.loop();
if(mode3Active){
digitalWrite(OUTPUT_SENSOR, HIGH);
}
if(millis() > 30000 && !mode3Active){
Serial << (millis()/ 1000) << "s gone" << endl;