Skip to content

Commit

Permalink
Fixed power saving
Browse files Browse the repository at this point in the history
  • Loading branch information
gskjold committed Nov 7, 2022
1 parent 775e5a0 commit 042e2bc
Showing 1 changed file with 11 additions and 1 deletion.
12 changes: 11 additions & 1 deletion src/AmsToMqttBridge.ino
Original file line number Diff line number Diff line change
Expand Up @@ -1116,7 +1116,17 @@ void WiFi_connect() {
WiFi.persistent(true);
if(WiFi.begin(wifi.ssid, wifi.psk)) {
if(wifi.sleep <= 2) {
WiFi.setSleep(wifi.sleep);
switch(wifi.sleep) {
case 0:
WiFi.setSleep(WIFI_PS_NONE);
break;
case 1:
WiFi.setSleep(WIFI_PS_MIN_MODEM);
break;
case 2:
WiFi.setSleep(WIFI_PS_MAX_MODEM);
break;
}
}
yield();
} else {
Expand Down

0 comments on commit 042e2bc

Please sign in to comment.