mirror of
https://github.com/HASwitchPlate/openHASP.git
synced 2025-07-26 04:36:38 +00:00
Add disconnect popup GUI
This commit is contained in:
parent
aa7115bef1
commit
503f0eb1f7
@ -4,7 +4,7 @@
|
|||||||
|
|
||||||
#include "hasp_conf.h"
|
#include "hasp_conf.h"
|
||||||
|
|
||||||
#if HASP_USE_WIFI>0
|
#if HASP_USE_WIFI > 0
|
||||||
|
|
||||||
#include "hasp_debug.h"
|
#include "hasp_debug.h"
|
||||||
#include "hasp_config.h"
|
#include "hasp_config.h"
|
||||||
@ -45,6 +45,7 @@ void wifiConnected(IPAddress ipaddress)
|
|||||||
{
|
{
|
||||||
Log.notice(F("WIFI: Received IP address %s"), ipaddress.toString().c_str());
|
Log.notice(F("WIFI: Received IP address %s"), ipaddress.toString().c_str());
|
||||||
Log.verbose(F("WIFI: Connected = %s"), WiFi.status() == WL_CONNECTED ? PSTR("yes") : PSTR("no"));
|
Log.verbose(F("WIFI: Connected = %s"), WiFi.status() == WL_CONNECTED ? PSTR("yes") : PSTR("no"));
|
||||||
|
haspProgressVal(255);
|
||||||
|
|
||||||
// if(isConnected) {
|
// if(isConnected) {
|
||||||
// mqttReconnect();
|
// mqttReconnect();
|
||||||
@ -57,7 +58,9 @@ void wifiConnected(IPAddress ipaddress)
|
|||||||
void wifiDisconnected(const char * ssid, uint8_t reason)
|
void wifiDisconnected(const char * ssid, uint8_t reason)
|
||||||
{
|
{
|
||||||
wifiReconnectCounter++;
|
wifiReconnectCounter++;
|
||||||
if(wifiReconnectCounter > 45) {
|
haspProgressVal(wifiReconnectCounter * 3);
|
||||||
|
haspProgressMsg(F("Wifi Disconnected"));
|
||||||
|
if(wifiReconnectCounter > 33) {
|
||||||
Log.error(F("WIFI: Retries exceed %u: Rebooting..."), wifiReconnectCounter);
|
Log.error(F("WIFI: Retries exceed %u: Rebooting..."), wifiReconnectCounter);
|
||||||
dispatchReboot(false);
|
dispatchReboot(false);
|
||||||
}
|
}
|
||||||
|
Loading…
x
Reference in New Issue
Block a user