Skip to content

Commit

Permalink
Version 1.42
Browse files Browse the repository at this point in the history
Fixed bug with ESP-NOW devices not getting restart or update command.
Minor main code refactoring.
  • Loading branch information
aZholtikov committed Feb 13, 2023
1 parent e4572cc commit cf32071
Showing 1 changed file with 6 additions and 2 deletions.
8 changes: 6 additions & 2 deletions src/main.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -193,12 +193,12 @@ void setup()

void loop()
{
if (mqttAvailabilityCheckTimerSemaphore)
checkMqttAvailability();
if (keepAliveMessageTimerSemaphore)
sendKeepAliveMessage();
if (attributesMessageTimerSemaphore)
sendAttributesMessage();
if (mqttAvailabilityCheckTimerSemaphore)
checkMqttAvailability();
if (workMode == ESP_NOW_WIFI)
mqttWifiClient.loop();
if (workMode == ESP_NOW_LAN)
Expand Down Expand Up @@ -679,6 +679,8 @@ void checkMqttAvailability()
mqttWifiClient.subscribe((topicPrefix + "/espnow_led/#").c_str());

sendConfigMessage();
sendAttributesMessage();
sendKeepAliveMessage();
}
}

Expand All @@ -696,6 +698,8 @@ void checkMqttAvailability()
mqttEthClient.subscribe((topicPrefix + "/espnow_led/#").c_str());

sendConfigMessage();
sendAttributesMessage();
sendKeepAliveMessage();
}
}
}
Expand Down

0 comments on commit cf32071

Please sign in to comment.