Compare commits
No commits in common. "945a46cde4e7a8b517581ebceec0aeb9a2cd3e05" and "9d36a758756f5c2aed8ceade38f91e7ebf115dfd" have entirely different histories.
945a46cde4
...
9d36a75875
|
|
@ -28,12 +28,12 @@ unsigned long lastStatusTime = 0;
|
||||||
void sendActionMessage(bool state) {
|
void sendActionMessage(bool state) {
|
||||||
if ( DEBUG ) Serial.println("Action button triggered");
|
if ( DEBUG ) Serial.println("Action button triggered");
|
||||||
String msgURL = actionURL + (state ? "true" : "false");
|
String msgURL = actionURL + (state ? "true" : "false");
|
||||||
WiFiClient client;
|
|
||||||
HTTPClient http;
|
HTTPClient http;
|
||||||
if ( BOARD == "ESP32" ) {
|
if ( BOARD == "ESP32" ) {
|
||||||
msgURL = "http://" + hostAddress + ":" + String(hostPort) + msgURL;
|
msgURL = "http://" + hostAddress + ":" + String(hostPort) + msgURL;
|
||||||
http.begin(msgURL.c_str());
|
http.begin(msgURL.c_str());
|
||||||
} else {
|
} else {
|
||||||
|
WiFiClient client;
|
||||||
http.begin(client, hostAddress.c_str(), hostPort, msgURL.c_str());
|
http.begin(client, hostAddress.c_str(), hostPort, msgURL.c_str());
|
||||||
}
|
}
|
||||||
http.GET();
|
http.GET();
|
||||||
|
|
@ -79,7 +79,7 @@ void loop() {
|
||||||
debouncing = true;
|
debouncing = true;
|
||||||
lastDebounceTime = currentMillis;
|
lastDebounceTime = currentMillis;
|
||||||
}
|
}
|
||||||
if ( debouncing && ((currentMillis - lastDebounceTime) >= DEBOUNCEMS) ) {
|
if ( debouncing && (currentMillis >= (lastDebounceTime + DEBOUNCEMS)) ) {
|
||||||
debouncing = false;
|
debouncing = false;
|
||||||
if ( buttonCheck != buttonState ) {
|
if ( buttonCheck != buttonState ) {
|
||||||
buttonState = buttonCheck;
|
buttonState = buttonCheck;
|
||||||
|
|
@ -91,5 +91,4 @@ void loop() {
|
||||||
}
|
}
|
||||||
lastButtonState = buttonCheck;
|
lastButtonState = buttonCheck;
|
||||||
ArduinoOTA.handle();
|
ArduinoOTA.handle();
|
||||||
yield();
|
|
||||||
}
|
}
|
||||||
|
|
|
||||||
Loading…
Reference in New Issue
Block a user