minimum light for tcs colortemp

master
interfisch 2 years ago
parent ff8582fa1e
commit 53c04c0077

@ -182,8 +182,7 @@ struct sensordata
struct sensordata dataTCS34725_colortemp;
uint16_t value_colortemp, value_tcs_lux, value_tcs_r,value_tcs_g,value_tcs_b,value_tcs_c;
unsigned long lastread_tcs34725=0;
#define TCS34725_MINLUXFORCT 30 //send only colortemperature values if lux is at least this high
#endif
#ifdef SENSOR_ANEMOMETER
@ -912,7 +911,11 @@ void loop_TCS34725_colortemp()
checkESPStatus();
Homie.getLogger() << "colortemp tcs " << ": " << value_colortemp << endl;
sensorNode.setProperty("colortemp").send(String(value_colortemp));
if (tcs.lux>=TCS34725_MINLUXFORCT) {
sensorNode.setProperty("colortemp").send(String(value_colortemp));
}else{
Homie.getLogger() << "didn't send tcs because light too low: " << tcs.lux << "lux" << endl;
}
d.lastsentvalue=value_colortemp;

Loading…
Cancel
Save