From 40007bbae991366f8b6f0b89ffd81eaff4801295 Mon Sep 17 00:00:00 2001 From: Theo Arends <11044339+arendst@users.noreply.github.com> Date: Wed, 13 Jan 2021 15:54:43 +0100 Subject: [PATCH] Add WIFI_NONE_SLEEP when sleep = 0 and SO60 = 0 --- tasmota/support_wifi.ino | 11 +++++++++++ 1 file changed, 11 insertions(+) diff --git a/tasmota/support_wifi.ino b/tasmota/support_wifi.ino index 845e115e6..95380cd74 100644 --- a/tasmota/support_wifi.ino +++ b/tasmota/support_wifi.ino @@ -153,11 +153,22 @@ void WiFiSetSleepMode(void) */ // Sleep explanation: https://github.com/esp8266/Arduino/blob/3f0c601cfe81439ce17e9bd5d28994a7ed144482/libraries/ESP8266WiFi/src/ESP8266WiFiGeneric.cpp#L255 +/* if (TasmotaGlobal.sleep && Settings.flag3.sleep_normal) { // SetOption60 - Enable normal sleep instead of dynamic sleep WiFi.setSleepMode(WIFI_LIGHT_SLEEP); // Allow light sleep during idle times } else { WiFi.setSleepMode(WIFI_MODEM_SLEEP); // Disable sleep (Esp8288/Arduino core and sdk default) } +*/ + if (TasmotaGlobal.sleep && Settings.flag3.sleep_normal) { // SetOption60 - Enable normal sleep instead of dynamic sleep + WiFi.setSleepMode(WIFI_LIGHT_SLEEP); // Allow light sleep during idle times + } else { + if (0 == TasmotaGlobal.sleep) { + WiFi.setSleepMode(WIFI_NONE_SLEEP); // Disable sleep + } else { + WiFi.setSleepMode(WIFI_MODEM_SLEEP); // Sleep (Esp8288/Arduino core and sdk default) + } + } WifiSetOutputPower(); }