Skip to content
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
6 changes: 2 additions & 4 deletions Controller/Controller.ino
Original file line number Diff line number Diff line change
Expand Up @@ -879,9 +879,7 @@ void loop() {
_otaCheckErrorCode = 0;
bool updateAvailable = otaFirmware.checkForUpdate();

if(updateAvailable){
otaFirmware.execOTA(); /* onAvailable already published MQTT update-available state */
} else if(_otaCheckFailed){
if(_otaCheckFailed){
eventLog.createEvent("OTA check failed");
/* onError already published "offline" to availability topic; do not overwrite with "online" */
if(deviceIdentity.enabled && mqttClient.connected()){
Expand Down Expand Up @@ -924,7 +922,7 @@ void loop() {
bufferedNotify.flush();
mqttClient.endPublish();
}
} else {
} else if(!updateAvailable){
/* Service reachable, no update — publish online + current version */
if(deviceIdentity.enabled && mqttClient.connected()){
char availability_topic[MQTT_TOPIC_UPDATE_AVAILABILITY_LENGTH+1];
Expand Down
Loading