diff --git a/ConfigSettings.h b/ConfigSettings.h index 29c9fca..0f124a7 100644 --- a/ConfigSettings.h +++ b/ConfigSettings.h @@ -3,7 +3,7 @@ #ifndef configsettings_h #define configsettings_h -#define FW_VERSION "v2.3.2" +#define FW_VERSION "v2.3.3" enum DeviceStatus { DS_OK = 0, DS_ERROR = 1, diff --git a/GitOTA.cpp b/GitOTA.cpp index 5c8d168..f85a020 100644 --- a/GitOTA.cpp +++ b/GitOTA.cpp @@ -304,6 +304,7 @@ void GitUpdater::toJSON(JsonObject &obj) { obj["status"] = this->status; obj["error"] = this->error; obj["cancelled"] = this->cancelled; + obj["checkForUpdate"] = settings.checkForUpdate; JsonObject fw = obj.createNestedObject("fwVersion"); settings.fwVersion.toJSON(fw); JsonObject app = obj.createNestedObject("appVersion"); diff --git a/SomfyController.ino.esp32.bin b/SomfyController.ino.esp32.bin index bd56edc..de17b99 100644 Binary files a/SomfyController.ino.esp32.bin and b/SomfyController.ino.esp32.bin differ diff --git a/SomfyController.ino.esp32s3.bin b/SomfyController.ino.esp32s3.bin index 980c5d4..72e35b1 100644 Binary files a/SomfyController.ino.esp32s3.bin and b/SomfyController.ino.esp32s3.bin differ diff --git a/SomfyController.littlefs.bin b/SomfyController.littlefs.bin index 6edcb7e..dcda1de 100644 Binary files a/SomfyController.littlefs.bin and b/SomfyController.littlefs.bin differ diff --git a/Web.cpp b/Web.cpp index 6e0614c..4934d89 100644 --- a/Web.cpp +++ b/Web.cpp @@ -794,8 +794,8 @@ void Web::handleDiscovery(WebServer &server) { char connType[10] = "Unknown"; if(net.connType == conn_types::ethernet) strcpy(connType, "Ethernet"); else if(net.connType == conn_types::wifi) strcpy(connType, "Wifi"); - snprintf(g_content, sizeof(g_content), "{\"serverId\":\"%s\",\"version\":\"%s\",\"latest\":\"%s\",\"model\":\"%s\",\"hostname\":\"%s\",\"authType\":%d,\"permissions\":%d,\"chipModel\":\"%s\",\"connType:\":\"%s\"", - settings.serverId, settings.fwVersion.name, git.latest.name, "ESPSomfyRTS", settings.hostname, static_cast(settings.Security.type), settings.Security.permissions, settings.chipModel, connType); + snprintf(g_content, sizeof(g_content), "{\"serverId\":\"%s\",\"version\":\"%s\",\"latest\":\"%s\",\"model\":\"%s\",\"hostname\":\"%s\",\"authType\":%d,\"permissions\":%d,\"chipModel\":\"%s\",\"connType\":\"%s\",\"checkForUpdate\":%s", + settings.serverId, settings.fwVersion.name, git.latest.name, "ESPSomfyRTS", settings.hostname, static_cast(settings.Security.type), settings.Security.permissions, settings.chipModel, connType, settings.checkForUpdate ? "true" : "false"); server.send_P(200, _encoding_json, g_content); server.sendContent(",\"rooms\":"); this->chunkRoomsResponse(server); @@ -2215,8 +2215,10 @@ void Web::begin() { if (method == HTTP_POST || method == HTTP_PUT) { // Parse out all the inputs. if (obj.containsKey("hostname") || obj.containsKey("ssdpBroadcast") || obj.containsKey("checkForUpdate")) { + bool checkForUpdate = settings.checkForUpdate; settings.fromJSON(obj); settings.save(); + if(settings.checkForUpdate != checkForUpdate) git.emitUpdateCheck(); if(obj.containsKey("hostname")) net.updateHostname(); } if (obj.containsKey("ntpServer") || obj.containsKey("ntpServer")) { diff --git a/data/appversion b/data/appversion index e703481..45674f1 100644 --- a/data/appversion +++ b/data/appversion @@ -1 +1 @@ -2.3.2 \ No newline at end of file +2.3.3 \ No newline at end of file diff --git a/data/index.html b/data/index.html index c046129..439b8cd 100644 --- a/data/index.html +++ b/data/index.html @@ -3,11 +3,11 @@ - - - + + + - +
diff --git a/data/index.js b/data/index.js index 1f5abb4..8de5569 100644 --- a/data/index.js +++ b/data/index.js @@ -1264,7 +1264,7 @@ var security = new Security(); class General { initialized = false; - appVersion = 'v2.3.2'; + appVersion = 'v2.3.3'; reloadApp = false; init() { if (this.initialized) return; @@ -4224,9 +4224,9 @@ class Firmware { procFwStatus(rel) { console.log(rel); let div = document.getElementById('divFirmwareUpdate'); - if (rel.updateAvailable && rel.status === 0) { - div.style.color = 'red'; - div.innerHTML = `Firmware ${rel.latest.name} Available`; + if (rel.available && rel.status === 0 && rel.checkForUpdate !== false) { + div.style.color = 'black'; + div.innerHTML = `Firmware ${rel.fwVersion.name} Installed ${rel.latest.name} Available`; } else { switch (rel.status) {