fix wifi disable

This commit is contained in:
Nicu Hodos 2021-12-31 09:22:21 +01:00
parent db9cd46ab5
commit af85295bb2

View File

@ -47,9 +47,7 @@ void onWifiConnected() {
Serial.println("Wifi connected event");
Wifi::printStatus();
Ota::tLoop.enable();
#if !WIFI_ALWAYS_ON
if (!Ir::avrOn) tCheckWifi.restartDelayed();
#endif
Mqtt::client.connect();
if (time_t newTime = Ntp::updateTime()) {
Serial.println(asctime(localtime(&newTime)));
@ -57,10 +55,12 @@ void onWifiConnected() {
}
void checkWifiCallback() {
#if !WIFI_ALWAYS_ON
Serial.println("Wifi connection timed out");
Mqtt::client.disconnect();
Ota::tLoop.disable();
Wifi::disconnect();
#endif
}
ICACHE_RAM_ATTR void onButtonPressed() {