use better name for stay connected constant
This commit is contained in:
parent
03a1fc0e21
commit
8f6f100fbb
@ -4,7 +4,7 @@
|
|||||||
#include "ntp_time.h"
|
#include "ntp_time.h"
|
||||||
#include "display.h"
|
#include "display.h"
|
||||||
|
|
||||||
#define STAY_CONNECTED_FOR_MINS(min) (min*60)
|
#define STAY_CONNECTED_AFTER_BOOT 1*60
|
||||||
|
|
||||||
int currentHour = -1;
|
int currentHour = -1;
|
||||||
time_t timeAtStartup;
|
time_t timeAtStartup;
|
||||||
@ -35,7 +35,7 @@ void loop() {
|
|||||||
}
|
}
|
||||||
if (WiFi.status() == WL_CONNECTED) {
|
if (WiFi.status() == WL_CONNECTED) {
|
||||||
ArduinoOTA.handle();
|
ArduinoOTA.handle();
|
||||||
if (difftime(now(), timeAtStartup) > STAY_CONNECTED_FOR_MINS(1)) {
|
if (difftime(now(), timeAtStartup) > STAY_CONNECTED_AFTER_BOOT) {
|
||||||
wifi.disconnect();
|
wifi.disconnect();
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|||||||
Loading…
x
Reference in New Issue
Block a user