Skip to content

Commit 35ef3ad

Browse files
committed
Bugfix - my additions.
1 parent b16a9c2 commit 35ef3ad

18 files changed

+15
-17
lines changed
Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,3 +1,3 @@
1-
/*.js.gz
2-
/edit.htm
1+
/*.gz
2+
/edit_gz
33
/.exclude.files
0 Bytes
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.

examples/SmartSwitch/SmartSwitch.ino

Lines changed: 8 additions & 10 deletions
Original file line numberDiff line numberDiff line change
@@ -204,8 +204,13 @@ void doOut(){
204204
if (ledOut != ledState){ // only if changed
205205
digitalWrite(ledPin, ledState); //consolidated here
206206
ledOut = ledState; //update
207-
if (ledState == LED_OFF) ws.textAll("led,ledoff");
208-
else ws.textAll("led,ledon");
207+
if (ledState == LED_OFF){
208+
ws.textAll("led,ledoff");
209+
Serial.println(F("LED-OFF"));
210+
} else {
211+
ws.textAll("led,ledon");
212+
Serial.println(F("LED-ON"));
213+
}
209214
}
210215
}
211216

@@ -257,7 +262,7 @@ void showTime()
257262
ledState = LED_ON;
258263
ws.textAll("led,ledon");
259264
}
260-
if ((((t - HYST) > ee.tempe)&&(ledState == LED_ON))||(!heat_enabled)){ // ON->OFF once, also turn off at end of period.
265+
if ((((t - HYST) > ee.tempe)&&(ledState == LED_ON))||(!heat_enabled)){ // ->OFF
261266
ledState = LED_OFF;
262267
ws.textAll("led,ledoff");
263268
}
@@ -290,13 +295,6 @@ void checkPhysicalButton()
290295
if (digitalRead(btnPin) == LOW){
291296
if (btnState != LOW){ // btnState is used to avoid sequential toggles
292297
ledState = !ledState;
293-
if (ledState == LED_OFF){
294-
ws.textAll("led,ledoff");
295-
Serial.println(F("LED-OFF"));
296-
} else {
297-
ws.textAll("led,ledon");
298-
Serial.println(F("LED-ON"));
299-
}
300298
}
301299
btnState = LOW;
302300
} else {
Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,3 +1,3 @@
11
/*.gz
2-
/edit.htm
2+
/edit_gz
33
/.exclude.files
0 Bytes
Binary file not shown.

0 commit comments

Comments
 (0)