Skip to content

Commit

Permalink
Minor changes
Browse files Browse the repository at this point in the history
  • Loading branch information
aZholtikov committed Dec 29, 2022
1 parent 028894a commit 70181f5
Showing 1 changed file with 4 additions and 4 deletions.
8 changes: 4 additions & 4 deletions src/main.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -50,7 +50,7 @@ String mqttUserLogin{""};
String mqttUserPassword{""};
String topicPrefix{"homeassistant"};

bool isWasConnectionToWifi{false};
bool wasConnectionToWifi{false};

ZHNetwork myNet;
AsyncWebServer webServer(80);
Expand Down Expand Up @@ -470,14 +470,14 @@ void connectToWifi()
{
if (WiFi.status() == WL_CONNECTED)
{
isWasConnectionToWifi = true;
wasConnectionToWifi = true;
wifiReconnectTimer.detach();
mqttClient.connect();
return;
}
if (WiFi.status() == WL_CONNECT_FAILED)
{
if (!isWasConnectionToWifi)
if (!wasConnectionToWifi)
{
WiFi.mode(WIFI_AP);
WiFi.softAP(("ESP-NOW Gateway " + myNet.getNodeMac()).c_str(), "12345678");
Expand All @@ -492,7 +492,7 @@ void connectToWifi()
WiFi.mode(WIFI_OFF); // Without rebooting WiFi stops working ESP-NOW.
myNet.begin(espnowNetName.c_str());
}
if (!isWasConnectionToWifi)
if (!wasConnectionToWifi)
{
WiFi.mode(WIFI_AP);
WiFi.softAP(("ESP-NOW Gateway " + myNet.getNodeMac()).c_str(), "12345678");
Expand Down

0 comments on commit 70181f5

Please sign in to comment.