dont try to sync if wifi is disconnected (just because whats the point really)

This commit is contained in:
Matthew Frost 2023-12-28 10:43:19 +01:00
parent 6a9976868b
commit 33db93deed

View file

@ -320,6 +320,7 @@ void handleData1Interrupt() {
#endif #endif
vTaskDelay(pdMS_TO_TICKS(15000)); // Delay for 15 seconds vTaskDelay(pdMS_TO_TICKS(15000)); // Delay for 15 seconds
if (WiFi.status() == WL_CONNECTED) {
Tinance2HttpClient httpClient; Tinance2HttpClient httpClient;
std::pair<String, int> responsePair = httpClient.sendHttpRequest(tinance2_url_readerinfo, "GET", ""); std::pair<String, int> responsePair = httpClient.sendHttpRequest(tinance2_url_readerinfo, "GET", "");
String response = responsePair.first; String response = responsePair.first;
@ -349,7 +350,7 @@ void handleData1Interrupt() {
Serial.println("JSON Reader Mode: " + json["mode"].as<String>()); Serial.println("JSON Reader Mode: " + json["mode"].as<String>());
#endif #endif
} }
}
} }
} }
#endif #endif