Skip to content

Commit

Permalink
Fix issue where connType has stray colon. Add checkForUpdate references.
Browse files Browse the repository at this point in the history
  • Loading branch information
rstrouse committed Feb 4, 2024
1 parent 234f9d9 commit ad6e604
Show file tree
Hide file tree
Showing 9 changed files with 15 additions and 12 deletions.
2 changes: 1 addition & 1 deletion ConfigSettings.h
Original file line number Diff line number Diff line change
Expand Up @@ -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,
Expand Down
1 change: 1 addition & 0 deletions GitOTA.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -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");
Expand Down
Binary file modified SomfyController.ino.esp32.bin
Binary file not shown.
Binary file modified SomfyController.ino.esp32s3.bin
Binary file not shown.
Binary file modified SomfyController.littlefs.bin
Binary file not shown.
6 changes: 4 additions & 2 deletions Web.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -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<uint8_t>(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<uint8_t>(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);
Expand Down Expand Up @@ -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")) {
Expand Down
2 changes: 1 addition & 1 deletion data/appversion
Original file line number Diff line number Diff line change
@@ -1 +1 @@
2.3.2
2.3.3
8 changes: 4 additions & 4 deletions data/index.html
Original file line number Diff line number Diff line change
Expand Up @@ -3,11 +3,11 @@
<head>
<meta name="viewport" content="width=device-width, initial-scale=1">
<meta charset="UTF-8">
<link rel="stylesheet" href="main.css?v=2.3.2c" type="text/css" />
<link rel="stylesheet" href="widgets.css?v=2.3.2c" type="text/css" />
<link rel="stylesheet" href="icons.css?v=2.3.2c" type="text/css" />
<link rel="stylesheet" href="main.css?v=2.3.3" type="text/css" />
<link rel="stylesheet" href="widgets.css?v=2.3.3" type="text/css" />
<link rel="stylesheet" href="icons.css?v=2.3.3" type="text/css" />
<link rel="icon" type="image/png" href="favicon.png" />
<script type="text/javascript" src="index.js?v=2.3.2c"></script>
<script type="text/javascript" src="index.js?v=2.3.3"></script>
</head>
<body>
<div id="divContainer" class="container main" data-auth="false">
Expand Down
8 changes: 4 additions & 4 deletions data/index.js
Original file line number Diff line number Diff line change
Expand Up @@ -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;
Expand Down Expand Up @@ -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 = `<span>Firmware ${rel.fwVersion.name} Installed<span><span style="color:red"> ${rel.latest.name} Available</span>`;
}
else {
switch (rel.status) {
Expand Down

0 comments on commit ad6e604

Please sign in to comment.