Skip to content

Commit 8217448

Browse files
committed
0.8.136
* fix save settings for ESP32 devices #1720
1 parent 83b386d commit 8217448

File tree

3 files changed

+22
-18
lines changed

3 files changed

+22
-18
lines changed

src/CHANGES.md

+3
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,8 @@
11
# Development Changes
22

3+
## 0.8.136 - 2024-08-12
4+
* fix save settings for ESP32 devices #1720
5+
36
## 0.8.135 - 2024-08-11
47
* translated `/system` #1717
58
* added default pin seetings for opendtufusion board

src/defines.h

+1-1
Original file line numberDiff line numberDiff line change
@@ -13,7 +13,7 @@
1313
//-------------------------------------
1414
#define VERSION_MAJOR 0
1515
#define VERSION_MINOR 8
16-
#define VERSION_PATCH 135
16+
#define VERSION_PATCH 136
1717
//-------------------------------------
1818
typedef struct {
1919
uint8_t ch;

src/web/html/setup.html

+18-17
Original file line numberDiff line numberDiff line change
@@ -682,20 +682,21 @@
682682
}
683683

684684
function parseSys(obj) {
685-
for(var i of [["device", "device_name"], ["ssid", "ssid"], ["ap_pwd", "ap_pwd"]])
686-
document.getElementsByName(i[0])[0].value = obj[i[1]];
687-
document.getElementsByName("hidd")[0].checked = obj["hidd"];
685+
document.getElementsByName("device")[0].value = obj.device_name;
686+
for(var i of [["ssid", "ssid"], ["ap_pwd", "ap_pwd"]])
687+
document.getElementsByName(i[0])[0].value = obj.network[i[1]];
688+
document.getElementsByName("hidd")[0].checked = obj.network.hidd;
688689

689-
document.getElementsByName("darkMode")[0].checked = obj["dark_mode"];
690-
document.getElementsByName("schedReboot")[0].checked = obj["sched_reboot"];
690+
document.getElementsByName("darkMode")[0].checked = obj.dark_mode;
691+
document.getElementsByName("schedReboot")[0].checked = obj.sched_reboot;
691692
e = document.getElementsByName("adminpwd")[0];
692-
if(!obj["pwd_set"])
693+
if(!obj.pwd_set)
693694
e.value = "";
694695
var d = document.getElementById("prot_mask");
695696
var a = ["Index", "{#NAV_LIVE}", "{#NAV_WEBSERIAL}", "{#NAV_SETTINGS}", "Update", "System", "{#NAV_HISTORY}"];
696697
var el = [];
697698
for(var i = 0; i < 7; i++) {
698-
var chk = ((obj["prot_mask"] & (1 << i)) == (1 << i));
699+
var chk = ((obj.prot_mask & (1 << i)) == (1 << i));
699700
el.push(mlCb("protMask" + i, a[i], chk))
700701
}
701702
d.append(...el);
@@ -720,7 +721,7 @@
720721
document.getElementsByName("cstLnkTxt")[0].value = obj.cst_lnk_txt
721722
}
722723

723-
ts = obj["ts_now"];
724+
ts = obj.ts_now;
724725
window.setInterval("tick()", 1000);
725726
}
726727

@@ -1330,23 +1331,23 @@
13301331

13311332
function parse(root) {
13321333
if(null != root) {
1333-
parseGeneric(root["generic"]);
1334-
parseSys(root["system"]);
1335-
parseStaticIp(root["static_ip"]);
1336-
parseMqtt(root["mqtt"]);
1337-
parseNtp(root["ntp"]);
1338-
parseSun(root["sun"]);
1334+
parseGeneric(root.generic);
1335+
parseSys(root.system);
1336+
parseStaticIp(root.static_ip);
1337+
parseMqtt(root.mqtt);
1338+
parseNtp(root.ntp);
1339+
parseSun(root.sun);
13391340
parsePinout(root.pinout);
1340-
parseNrfRadio(root["radioNrf"], root["pinout"]);
1341+
parseNrfRadio(root.radioNrf, root.pinout);
13411342
/*IF_ESP32*/
13421343
parseCmtRadio(root.radioCmt);
13431344
/*ENDIF_ESP32*/
13441345
/*IF_ETHERNET*/
13451346
parseEth(root.eth)
13461347
/*ENDIF_ETHERNET*/
1347-
parseSerial(root["serial"]);
1348+
parseSerial(root.serial);
13481349
/*IF_PLUGIN_DISPLAY*/
1349-
parseDisplay(root["display"], root["system"]["esp_type"], root["system"]);
1350+
parseDisplay(root.display, root.system.esp_type, root.system);
13501351
/*ENDIF_PLUGIN_DISPLAY*/
13511352
getAjax("/api/inverter/list", parseIv);
13521353
}

0 commit comments

Comments
 (0)