mirror of
https://github.com/rstrouse/ESPSomfy-RTS.git
synced 2025-12-13 02:52:11 +01:00
Fix issue where connType has stray colon. Add checkForUpdate references.
This commit is contained in:
parent
234f9d9eb5
commit
ad6e604f17
9 changed files with 15 additions and 12 deletions
|
|
@ -3,7 +3,7 @@
|
||||||
#ifndef configsettings_h
|
#ifndef configsettings_h
|
||||||
#define configsettings_h
|
#define configsettings_h
|
||||||
|
|
||||||
#define FW_VERSION "v2.3.2"
|
#define FW_VERSION "v2.3.3"
|
||||||
enum DeviceStatus {
|
enum DeviceStatus {
|
||||||
DS_OK = 0,
|
DS_OK = 0,
|
||||||
DS_ERROR = 1,
|
DS_ERROR = 1,
|
||||||
|
|
|
||||||
|
|
@ -304,6 +304,7 @@ void GitUpdater::toJSON(JsonObject &obj) {
|
||||||
obj["status"] = this->status;
|
obj["status"] = this->status;
|
||||||
obj["error"] = this->error;
|
obj["error"] = this->error;
|
||||||
obj["cancelled"] = this->cancelled;
|
obj["cancelled"] = this->cancelled;
|
||||||
|
obj["checkForUpdate"] = settings.checkForUpdate;
|
||||||
JsonObject fw = obj.createNestedObject("fwVersion");
|
JsonObject fw = obj.createNestedObject("fwVersion");
|
||||||
settings.fwVersion.toJSON(fw);
|
settings.fwVersion.toJSON(fw);
|
||||||
JsonObject app = obj.createNestedObject("appVersion");
|
JsonObject app = obj.createNestedObject("appVersion");
|
||||||
|
|
|
||||||
Binary file not shown.
Binary file not shown.
Binary file not shown.
6
Web.cpp
6
Web.cpp
|
|
@ -794,8 +794,8 @@ void Web::handleDiscovery(WebServer &server) {
|
||||||
char connType[10] = "Unknown";
|
char connType[10] = "Unknown";
|
||||||
if(net.connType == conn_types::ethernet) strcpy(connType, "Ethernet");
|
if(net.connType == conn_types::ethernet) strcpy(connType, "Ethernet");
|
||||||
else if(net.connType == conn_types::wifi) strcpy(connType, "Wifi");
|
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\"",
|
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.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.send_P(200, _encoding_json, g_content);
|
||||||
server.sendContent(",\"rooms\":");
|
server.sendContent(",\"rooms\":");
|
||||||
this->chunkRoomsResponse(server);
|
this->chunkRoomsResponse(server);
|
||||||
|
|
@ -2215,8 +2215,10 @@ void Web::begin() {
|
||||||
if (method == HTTP_POST || method == HTTP_PUT) {
|
if (method == HTTP_POST || method == HTTP_PUT) {
|
||||||
// Parse out all the inputs.
|
// Parse out all the inputs.
|
||||||
if (obj.containsKey("hostname") || obj.containsKey("ssdpBroadcast") || obj.containsKey("checkForUpdate")) {
|
if (obj.containsKey("hostname") || obj.containsKey("ssdpBroadcast") || obj.containsKey("checkForUpdate")) {
|
||||||
|
bool checkForUpdate = settings.checkForUpdate;
|
||||||
settings.fromJSON(obj);
|
settings.fromJSON(obj);
|
||||||
settings.save();
|
settings.save();
|
||||||
|
if(settings.checkForUpdate != checkForUpdate) git.emitUpdateCheck();
|
||||||
if(obj.containsKey("hostname")) net.updateHostname();
|
if(obj.containsKey("hostname")) net.updateHostname();
|
||||||
}
|
}
|
||||||
if (obj.containsKey("ntpServer") || obj.containsKey("ntpServer")) {
|
if (obj.containsKey("ntpServer") || obj.containsKey("ntpServer")) {
|
||||||
|
|
|
||||||
|
|
@ -1 +1 @@
|
||||||
2.3.2
|
2.3.3
|
||||||
|
|
@ -3,11 +3,11 @@
|
||||||
<head>
|
<head>
|
||||||
<meta name="viewport" content="width=device-width, initial-scale=1">
|
<meta name="viewport" content="width=device-width, initial-scale=1">
|
||||||
<meta charset="UTF-8">
|
<meta charset="UTF-8">
|
||||||
<link rel="stylesheet" href="main.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.2c" 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.2c" 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" />
|
<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>
|
</head>
|
||||||
<body>
|
<body>
|
||||||
<div id="divContainer" class="container main" data-auth="false">
|
<div id="divContainer" class="container main" data-auth="false">
|
||||||
|
|
|
||||||
|
|
@ -1264,7 +1264,7 @@ var security = new Security();
|
||||||
|
|
||||||
class General {
|
class General {
|
||||||
initialized = false;
|
initialized = false;
|
||||||
appVersion = 'v2.3.2';
|
appVersion = 'v2.3.3';
|
||||||
reloadApp = false;
|
reloadApp = false;
|
||||||
init() {
|
init() {
|
||||||
if (this.initialized) return;
|
if (this.initialized) return;
|
||||||
|
|
@ -4224,9 +4224,9 @@ class Firmware {
|
||||||
procFwStatus(rel) {
|
procFwStatus(rel) {
|
||||||
console.log(rel);
|
console.log(rel);
|
||||||
let div = document.getElementById('divFirmwareUpdate');
|
let div = document.getElementById('divFirmwareUpdate');
|
||||||
if (rel.updateAvailable && rel.status === 0) {
|
if (rel.available && rel.status === 0 && rel.checkForUpdate !== false) {
|
||||||
div.style.color = 'red';
|
div.style.color = 'black';
|
||||||
div.innerHTML = `Firmware ${rel.latest.name} Available`;
|
div.innerHTML = `<span>Firmware ${rel.fwVersion.name} Installed<span><span style="color:red"> ${rel.latest.name} Available</span>`;
|
||||||
}
|
}
|
||||||
else {
|
else {
|
||||||
switch (rel.status) {
|
switch (rel.status) {
|
||||||
|
|
|
||||||
Loading…
Add table
Add a link
Reference in a new issue