Browse Source

## 0.6.6 2022-11-25

* changed order when switching mode with physical mode button so that less button presses are required to toggle i.E. from Normal to Reduction 1 and back
  * Normal > Reduction 1 > Reduction 2
  * Reduction 1 > Normal > Reduction 2
  * Reduction 2 > Normal > Reduction 1
FloKra 1 year ago
parent
commit
ba6171b82a

+ 7 - 0
CHANGELOG.md

@@ -1,5 +1,12 @@
 # WiFiThermostat - Changelog
 
+## 0.6.6 2022-11-25
+
+* changed order when switching mode with physical mode button so that less button presses are required to toggle i.E. from Normal to Reduction 1 and back
+  * Normal > Reduction 1 > Reduction 2
+  * Reduction 1 > Normal > Reduction 2
+  * Reduction 2 > Normal > Reduction 1
+
 ## 0.6.5 2022-11-25
 
 * fix/workaround minHeatingOffTime active after reboot

BIN
releases/bin/WiFiThermostat.ino.d1_mini.20221125_v0.6.6.bin


BIN
releases/src/WiFiThermostat_0.6.6.zip


+ 20 - 3
src/thermostat.ino

@@ -199,9 +199,26 @@ void togglePreset() {
   //    else if (pendingPreset == 2 && !pendingPresetToggle) pendingPreset = 0;
   //    else if (pendingPreset == 2 && pendingPresetToggle) pendingPreset = 1;
 
-  if (pendingPreset == 0) pendingPreset = 1;
-  else if (pendingPreset == 1) pendingPreset = 2;
-  else if (pendingPreset == 2) pendingPreset = 0;
+  // pendingPreset 0 => Normal
+  // pendingPreset 1 => Reduction 1
+  // pendingPreset 2 => Reduction 2
+
+  if(preset == 0) {  // Normal > Reduction 1 > Reduction 2
+    if (pendingPreset == 0) pendingPreset = 1;
+    else if (pendingPreset == 1) pendingPreset = 2;
+    else if (pendingPreset == 2) pendingPreset = 0;
+  }
+  else if(preset == 1) {  // Reduction 1 > Normal > Reduction 2
+    if (pendingPreset == 1) pendingPreset = 0;
+    else if (pendingPreset == 0) pendingPreset = 2;
+    else if (pendingPreset == 2) pendingPreset = 1;
+  }
+  else if(preset == 2) {  // Reduction 2 > Normal > Reduction 1
+    if (pendingPreset == 2) pendingPreset = 0;
+    else if (pendingPreset == 0) pendingPreset = 1;
+    else if (pendingPreset == 1) pendingPreset = 2;
+  }
+  
 
   //  if (preset == 0 && pendingPreset == 0) pendingPreset = 1;
   //  else if (preset == 0 && pendingPreset == 1) pendingPreset = 2;