fix wifi disable
This commit is contained in:
parent
db9cd46ab5
commit
af85295bb2
@ -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() {
|
||||
|
||||
Loading…
x
Reference in New Issue
Block a user