mirror of
https://github.com/rstrouse/ESPSomfy-RTS.git
synced 2025-12-12 18:42:10 +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
|
||||
#define configsettings_h
|
||||
|
||||
#define FW_VERSION "v2.3.2"
|
||||
#define FW_VERSION "v2.3.3"
|
||||
enum DeviceStatus {
|
||||
DS_OK = 0,
|
||||
DS_ERROR = 1,
|
||||
|
|
|
|||
|
|
@ -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");
|
||||
|
|
|
|||
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";
|
||||
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);
|
||||
|
|
@ -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")) {
|
||||
|
|
|
|||
|
|
@ -1 +1 @@
|
|||
2.3.2
|
||||
2.3.3
|
||||
|
|
@ -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">
|
||||
|
|
|
|||
|
|
@ -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 = `<span>Firmware ${rel.fwVersion.name} Installed<span><span style="color:red"> ${rel.latest.name} Available</span>`;
|
||||
}
|
||||
else {
|
||||
switch (rel.status) {
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue