Skip to content

Commit ad6e604

Browse files
author
Robert Strouse
committed
Fix issue where connType has stray colon. Add checkForUpdate references.
1 parent 234f9d9 commit ad6e604

File tree

9 files changed

+15
-12
lines changed

9 files changed

+15
-12
lines changed

ConfigSettings.h

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -3,7 +3,7 @@
33
#ifndef configsettings_h
44
#define configsettings_h
55

6-
#define FW_VERSION "v2.3.2"
6+
#define FW_VERSION "v2.3.3"
77
enum DeviceStatus {
88
DS_OK = 0,
99
DS_ERROR = 1,

GitOTA.cpp

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -304,6 +304,7 @@ void GitUpdater::toJSON(JsonObject &obj) {
304304
obj["status"] = this->status;
305305
obj["error"] = this->error;
306306
obj["cancelled"] = this->cancelled;
307+
obj["checkForUpdate"] = settings.checkForUpdate;
307308
JsonObject fw = obj.createNestedObject("fwVersion");
308309
settings.fwVersion.toJSON(fw);
309310
JsonObject app = obj.createNestedObject("appVersion");

SomfyController.ino.esp32.bin

80 Bytes
Binary file not shown.

SomfyController.ino.esp32s3.bin

80 Bytes
Binary file not shown.

SomfyController.littlefs.bin

0 Bytes
Binary file not shown.

Web.cpp

Lines changed: 4 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -794,8 +794,8 @@ void Web::handleDiscovery(WebServer &server) {
794794
char connType[10] = "Unknown";
795795
if(net.connType == conn_types::ethernet) strcpy(connType, "Ethernet");
796796
else if(net.connType == conn_types::wifi) strcpy(connType, "Wifi");
797-
snprintf(g_content, sizeof(g_content), "{\"serverId\":\"%s\",\"version\":\"%s\",\"latest\":\"%s\",\"model\":\"%s\",\"hostname\":\"%s\",\"authType\":%d,\"permissions\":%d,\"chipModel\":\"%s\",\"connType:\":\"%s\"",
798-
settings.serverId, settings.fwVersion.name, git.latest.name, "ESPSomfyRTS", settings.hostname, static_cast<uint8_t>(settings.Security.type), settings.Security.permissions, settings.chipModel, connType);
797+
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",
798+
settings.serverId, settings.fwVersion.name, git.latest.name, "ESPSomfyRTS", settings.hostname, static_cast<uint8_t>(settings.Security.type), settings.Security.permissions, settings.chipModel, connType, settings.checkForUpdate ? "true" : "false");
799799
server.send_P(200, _encoding_json, g_content);
800800
server.sendContent(",\"rooms\":");
801801
this->chunkRoomsResponse(server);
@@ -2215,8 +2215,10 @@ void Web::begin() {
22152215
if (method == HTTP_POST || method == HTTP_PUT) {
22162216
// Parse out all the inputs.
22172217
if (obj.containsKey("hostname") || obj.containsKey("ssdpBroadcast") || obj.containsKey("checkForUpdate")) {
2218+
bool checkForUpdate = settings.checkForUpdate;
22182219
settings.fromJSON(obj);
22192220
settings.save();
2221+
if(settings.checkForUpdate != checkForUpdate) git.emitUpdateCheck();
22202222
if(obj.containsKey("hostname")) net.updateHostname();
22212223
}
22222224
if (obj.containsKey("ntpServer") || obj.containsKey("ntpServer")) {

data/appversion

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1 +1 @@
1-
2.3.2
1+
2.3.3

data/index.html

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -3,11 +3,11 @@
33
<head>
44
<meta name="viewport" content="width=device-width, initial-scale=1">
55
<meta charset="UTF-8">
6-
<link rel="stylesheet" href="main.css?v=2.3.2c" type="text/css" />
7-
<link rel="stylesheet" href="widgets.css?v=2.3.2c" type="text/css" />
8-
<link rel="stylesheet" href="icons.css?v=2.3.2c" type="text/css" />
6+
<link rel="stylesheet" href="main.css?v=2.3.3" type="text/css" />
7+
<link rel="stylesheet" href="widgets.css?v=2.3.3" type="text/css" />
8+
<link rel="stylesheet" href="icons.css?v=2.3.3" type="text/css" />
99
<link rel="icon" type="image/png" href="favicon.png" />
10-
<script type="text/javascript" src="index.js?v=2.3.2c"></script>
10+
<script type="text/javascript" src="index.js?v=2.3.3"></script>
1111
</head>
1212
<body>
1313
<div id="divContainer" class="container main" data-auth="false">

data/index.js

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -1264,7 +1264,7 @@ var security = new Security();
12641264

12651265
class General {
12661266
initialized = false;
1267-
appVersion = 'v2.3.2';
1267+
appVersion = 'v2.3.3';
12681268
reloadApp = false;
12691269
init() {
12701270
if (this.initialized) return;
@@ -4224,9 +4224,9 @@ class Firmware {
42244224
procFwStatus(rel) {
42254225
console.log(rel);
42264226
let div = document.getElementById('divFirmwareUpdate');
4227-
if (rel.updateAvailable && rel.status === 0) {
4228-
div.style.color = 'red';
4229-
div.innerHTML = `Firmware ${rel.latest.name} Available`;
4227+
if (rel.available && rel.status === 0 && rel.checkForUpdate !== false) {
4228+
div.style.color = 'black';
4229+
div.innerHTML = `<span>Firmware ${rel.fwVersion.name} Installed<span><span style="color:red"> ${rel.latest.name} Available</span>`;
42304230
}
42314231
else {
42324232
switch (rel.status) {

0 commit comments

Comments
 (0)