Improve Wifi connection and portal

This commit is contained in:
iranl
2024-10-18 20:36:32 +02:00
parent 72ef5003ad
commit 93b1d47bda
7 changed files with 193 additions and 162 deletions

View File

@@ -170,6 +170,11 @@ NetworkDevice *NukiNetwork::device()
return _device;
}
bool NukiNetwork::isConnected()
{
return _device->isConnected();
}
#ifdef NUKI_HUB_UPDATER
void NukiNetwork::initialize()
{
@@ -427,7 +432,7 @@ bool NukiNetwork::update()
});
}
if(_logIp && device()->isConnected() && !_device->localIP().equals("0.0.0.0"))
if(_logIp && _device->isConnected() && !_device->localIP().equals("0.0.0.0"))
{
_logIp = false;
Log->print(F("IP: "));
@@ -1083,11 +1088,12 @@ void NukiNetwork::publishHASSConfig(char* deviceType, const char* baseTopic, cha
baseTopic,
_lockPath + mqtt_topic_uptime,
deviceType,
"",
"duration",
"",
"diagnostic",
"",
{ { (char*)"en", (char*)"true" }});
{ { (char*)"en", (char*)"true" },
{ (char*)"unit_of_meas", (char*)"min"}});
if(_preferences->getBool(preference_mqtt_log_enabled, false))
{
@@ -3906,9 +3912,4 @@ String NukiNetwork::localIP()
{
return _device->localIP();
}
bool NukiNetwork::isConnected()
{
return _device->isConnected();
}
#endif