Adding Invert commands to groups

This commit is contained in:
Robert Strouse 2024-01-05 17:03:45 -08:00
parent 4272d2245e
commit 9d3d7ae21f
9 changed files with 56 additions and 14 deletions

View file

@ -375,6 +375,7 @@ bool GitUpdater::beginUpdate(const char *version) {
this->error = this->downloadFile();
if(this->error == 0) {
settings.fwVersion.parse(version);
delay(100);
Serial.println("Committing Configuration...");
somfy.commit();
rebootDelay.reboot = true;
@ -415,6 +416,7 @@ int8_t GitUpdater::downloadFile() {
uint8_t *buff = (uint8_t *)malloc(MAX_BUFF_SIZE);
if(buff) {
this->emitDownloadProgress(len, total);
int timeouts = 0;
while(https.connected() && (len > 0 || len == -1) && total < len) {
size_t size = stream->available();
if(size) {
@ -453,6 +455,19 @@ int8_t GitUpdater::downloadFile() {
https.end();
}
}
else {
timeouts++;
if(timeouts >= 300) {
Update.abort();
https.end();
free(buff);
Serial.println("Stream timeout!!!");
return -43;
}
sockEmit.loop();
webServer.loop();
delay(100);
}
}
free(buff);
if(len > total) {