From 1422636c6b4b3838bfea88cbe0cf7c3fc1e8c765 Mon Sep 17 00:00:00 2001 From: Fisch Date: Sun, 1 Nov 2020 20:20:03 +0100 Subject: [PATCH] send -1 if coloretemp not ok --- src/main.cpp | 8 ++++---- 1 file changed, 4 insertions(+), 4 deletions(-) diff --git a/src/main.cpp b/src/main.cpp index ec51962..41e592c 100644 --- a/src/main.cpp +++ b/src/main.cpp @@ -259,7 +259,7 @@ void setup() { #ifdef SENSOR_BMP180 Serial.println("initializing bmp180"); if (!bmp180.begin()){ - Serial.println("#ERROR: BMP180 init fail\n\n"); + Serial.println("#ERROR: BMP180 init fail\n"); }else{ bmp180init_ok=true; //stays false if init failed, sensor will not be read in loop } @@ -947,9 +947,11 @@ void loop_TCS34725_colortemp() sensorNode.setProperty("colortemp").send(String(value_colortemp)); }else{ Homie.getLogger() << "didn't send tcs ct because value is too low" << endl; + sensorNode.setProperty("colortemp").send(String(-1)); } }else{ Homie.getLogger() << "didn't send tcs ct because light too low: " << tcs.lux << "lux" << endl; + sensorNode.setProperty("colortemp").send(String(-1)); } d.lastsentvalue=value_colortemp; @@ -1010,11 +1012,9 @@ void loop_raingauge() }else{ value_raingauge=3600000/(millis()-raingauge_lasttimereset)/raingauge_pulsecounter*RAINGAUGE_FLIPAMOUNT; } - } - - if (abs((int)d.lastsentvalue-value_raingauge)>=d.minchange){ //int abs //for raingauge minchange should be 0 (send every change) _changed=true; } + d.lastreadtime=millis(); }