@@ -139,6 +139,7 @@ void BootNormal::loop() {
139
139
return ;
140
140
}
141
141
142
+ if (_otaOngoing) return ;
142
143
// here, we finished the advertisement
143
144
144
145
if (!_mqttConnectNotified) {
@@ -217,7 +218,8 @@ bool BootNormal::_publishOtaStatus(int status, const char* info) {
217
218
payload.concat (info);
218
219
}
219
220
220
- return Interface::get ().getMqttClient ().publish (_prefixMqttTopic (PSTR (" /$implementation/ota/status" )), 0 , true , payload.c_str ()) != 0 ;
221
+ return Interface::get ().getMqttClient ().publish (
222
+ _prefixMqttTopic (PSTR (" /$implementation/ota/status" )), 0 , true , payload.c_str ()) != 0 ;
221
223
}
222
224
223
225
void BootNormal::_endOtaUpdate (bool success, uint8_t update_error) {
@@ -1025,9 +1027,14 @@ bool HomieInternals::BootNormal::__handleOTAUpdates(char* topic, char* payload,
1025
1027
Interface::get ().event .sizeTotal = _otaSizeTotal;
1026
1028
Interface::get ().eventHandler (Interface::get ().event );
1027
1029
1028
- _publishOtaStatus (206 , progress.c_str ()); // 206 Partial Content
1030
+ static int count = 0 ;
1031
+ if (count == 100 ) {
1032
+ _publishOtaStatus (206 , progress.c_str ()); // 206 Partial Content
1033
+ count = 0 ;
1034
+ }
1035
+ ++count;
1029
1036
1030
- // Done with the update?
1037
+ // Done with the update?
1031
1038
if (index + len == total) {
1032
1039
// With base64-coded firmware, we may have provided a length off by one or two
1033
1040
// to Update.begin() because the base64-coded firmware may use padding (one or
0 commit comments