Merge branch 'dev' into full-seg-sync

This commit is contained in:
Blaz Kristan 2022-01-13 20:07:08 +01:00
commit 4602ec7688
2 changed files with 29 additions and 22 deletions

View File

@ -128,6 +128,7 @@ class UsermodTemperature : public Usermod {
} }
} }
} }
DEBUG_PRINTLN(F("Sensor NOT found."));
return false; return false;
} }
@ -162,6 +163,7 @@ class UsermodTemperature : public Usermod {
void loop() { void loop() {
if (!enabled || !sensorFound || strip.isUpdating()) return; if (!enabled || !sensorFound || strip.isUpdating()) return;
static uint8_t errorCount = 0;
unsigned long now = millis(); unsigned long now = millis();
// check to see if we are due for taking a measurement // check to see if we are due for taking a measurement
@ -179,7 +181,12 @@ class UsermodTemperature : public Usermod {
// we were waiting for a conversion to complete, have we waited log enough? // we were waiting for a conversion to complete, have we waited log enough?
if (now - lastTemperaturesRequest >= 750 /* 93.75ms per the datasheet but can be up to 750ms */) { if (now - lastTemperaturesRequest >= 750 /* 93.75ms per the datasheet but can be up to 750ms */) {
readTemperature(); readTemperature();
if (getTemperatureC() < -100.0f) lastMeasurement = now - readingInterval + 300; // force new measurement in 300ms if (getTemperatureC() < -100.0f) {
if (++errorCount > 10) sensorFound = 0;
lastMeasurement = now - readingInterval + 300; // force new measurement in 300ms
return;
}
errorCount = 0;
if (WLED_MQTT_CONNECTED) { if (WLED_MQTT_CONNECTED) {
char subuf[64]; char subuf[64];

View File

@ -1243,28 +1243,28 @@ const char JSON_mode_names[] PROGMEM = R"=====([
"Blink@!,;!,!,;!", "Blink@!,;!,!,;!",
"Breathe@!,;!,!;!", "Breathe@!,;!,!;!",
"Wipe@!,!;!,!,;!", "Wipe@!,!;!,!,;!",
"Wipe Random@!,;;!", "Wipe Random@!,;1,2,3;!",
"Random Colors@!,Fade time;;!", "Random Colors@!,Fade time;1,2,3;!",
"Sweep@!,!;!,!,;!", "Sweep@!,!;!,!,;!",
"Dynamic", "Dynamic@!,!;1,2,3;!",
"Colorloop@!,Saturation;;!", "Colorloop@!,Saturation;1,2,3;!",
"Rainbow", "Rainbow@!,Size;1,2,3;!",
"Scan@!,# of dots;!,!,;!", "Scan@!,# of dots;!,!,;!",
"Scan Dual@!,# of dots;!,!,;!", "Scan Dual@!,# of dots;!,!,;!",
"Fade", "Fade@!,;!,!,;!",
"Theater@!,Gap size;!,!,;!", "Theater@!,Gap size;!,!,;!",
"Theater Rainbow", "Theater Rainbow!,Gap size;1,2,3;!",
"Running@!,Wave width;!,!,;!", "Running@!,Wave width;!,!,;!",
"Saw@!,Width;!,!,;!", "Saw@!,Width;!,!,;!",
"Twinkle", "Twinkle@!,;!,!,;!",
"Dissolve", "Dissolve@Repeat speed,Dissolve speed;!,!,;!",
"Dissolve Rnd", "Dissolve Rnd@Repeat speed,Dissolve speed;,!,;!",
"Sparkle@!,;!,!,;!", "Sparkle@!,;!,!,;!",
"Sparkle Dark@!,!;Bg,Fx,;!", "Sparkle Dark@!,!;Bg,Fx,;!",
"Sparkle+@!,!;Bg,Fx,;!", "Sparkle+@!,!;Bg,Fx,;!",
"Strobe", "Strobe@!,;!,!,;!",
"Strobe Rainbow", "Strobe Rainbow@!,;,!,;!",
"Strobe Mega", "Strobe Mega@!,!;!,!,;!",
"Blink Rainbow@Frequency,Blink duration;!,!,;!", "Blink Rainbow@Frequency,Blink duration;!,!,;!",
"Android@!,Width;!,!,;!", "Android@!,Width;!,!,;!",
"Chase@!,Width;!,!,!;!", "Chase@!,Width;!,!,!;!",
@ -1272,9 +1272,9 @@ const char JSON_mode_names[] PROGMEM = R"=====([
"Chase Rainbow@!,Width;!,!,;0", "Chase Rainbow@!,Width;!,!,;0",
"Chase Flash@!,;Bg,Fx,!;!", "Chase Flash@!,;Bg,Fx,!;!",
"Chase Flash Rnd@!,;,Fx,;!", "Chase Flash Rnd@!,;,Fx,;!",
"Rainbow Runner", "Rainbow Runner@!,Size;Bg,,;!",
"Colorful@!,Saturation;1,2,3;!", "Colorful@!,Saturation;1,2,3;!",
"Traffic Light", "Traffic Light@!,;,!,;!",
"Sweep Random", "Sweep Random",
"Chase 2@!,Width;!,!,;!", "Chase 2@!,Width;!,!,;!",
"Aurora@!=24,!;1,2,3;!=50", "Aurora@!=24,!;1,2,3;!=50",
@ -1304,17 +1304,17 @@ const char JSON_mode_names[] PROGMEM = R"=====([
"Oscillate", "Oscillate",
"Pride 2015@!,;;", "Pride 2015@!,;;",
"Juggle@!=16,Trail=240;!,!,;!", "Juggle@!=16,Trail=240;!,!,;!",
"Palette@!,;;!", "Palette@!,;1,2,3;!",
"Fire 2012@Spark rate=120,Decay=64;;!", "Fire 2012@Spark rate=120,Decay=64;1,2,3;!",
"Colorwaves", "Colorwaves",
"Bpm@!=64,;,,,;!", "Bpm@!=64,;1,2,3;!",
"Fill Noise", "Fill Noise",
"Noise 1", "Noise 1",
"Noise 2", "Noise 2",
"Noise 3", "Noise 3",
"Noise 4", "Noise 4",
"Colortwinkles@Fade speed,Spawn speed;1,2,3;!", "Colortwinkles@Fade speed,Spawn speed;1,2,3;!",
"Lake@!,;,,,;!", "Lake@!,;1,2,3;!",
"Meteor@!,Trail length;!,!,;!", "Meteor@!,Trail length;!,!,;!",
"Meteor Smooth@!,Trail length;!,!,;!", "Meteor Smooth@!,Trail length;!,!,;!",
"Railway", "Railway",
@ -1339,7 +1339,7 @@ const char JSON_mode_names[] PROGMEM = R"=====([
"Plasma@Phase,;1,2,3;!", "Plasma@Phase,;1,2,3;!",
"Percent@,% of fill;!,!,;!", "Percent@,% of fill;!,!,;!",
"Ripple Rainbow", "Ripple Rainbow",
"Heartbeat", "Heartbeat@!,!;!,!,;!",
"Pacifica", "Pacifica",
"Candle Multi@Flicker rate=96,Flicker intensity=224;!,!,;0", "Candle Multi@Flicker rate=96,Flicker intensity=224;!,!,;0",
"Solid Glitter@,!;!,,;0", "Solid Glitter@,!;!,,;0",
@ -1353,7 +1353,7 @@ const char JSON_mode_names[] PROGMEM = R"=====([
"Chunchun@!,Gap size;!,!,;!", "Chunchun@!,Gap size;!,!,;!",
"Dancing Shadows@!,# of shadows;!,,;!", "Dancing Shadows@!,# of shadows;!,,;!",
"Washing Machine", "Washing Machine",
"Candy Cane@!,Width;,,,;", "Candy Cane@!,Width;;",
"Blends@Shift speed,Blend speed;1,2,3,!", "Blends@Shift speed,Blend speed;1,2,3,!",
"TV Simulator", "TV Simulator",
"Dynamic Smooth" "Dynamic Smooth"