mirror of
https://github.com/lumapu/ahoy.git
synced 2025-07-13 14:37:16 +02:00
0.7.39
* fix background color of invalid inputs * add hardware info (click in `live` on inverter name)
This commit is contained in:
parent
46f9056692
commit
3312fe7108
7 changed files with 29 additions and 18 deletions
|
@ -1,5 +1,9 @@
|
||||||
# Development Changes
|
# Development Changes
|
||||||
|
|
||||||
|
## 0.7.39 - 2023-08-21
|
||||||
|
* fix background color of invalid inputs
|
||||||
|
* add hardware info (click in `live` on inverter name)
|
||||||
|
|
||||||
## 0.7.38 - 2023-08-21
|
## 0.7.38 - 2023-08-21
|
||||||
* reset alarms at midnight (if inverter is not available) #1105, #1096
|
* reset alarms at midnight (if inverter is not available) #1105, #1096
|
||||||
* add option to reset 'max' values on midnight #1102
|
* add option to reset 'max' values on midnight #1102
|
||||||
|
|
|
@ -13,7 +13,7 @@
|
||||||
//-------------------------------------
|
//-------------------------------------
|
||||||
#define VERSION_MAJOR 0
|
#define VERSION_MAJOR 0
|
||||||
#define VERSION_MINOR 7
|
#define VERSION_MINOR 7
|
||||||
#define VERSION_PATCH 38
|
#define VERSION_PATCH 39
|
||||||
|
|
||||||
//-------------------------------------
|
//-------------------------------------
|
||||||
typedef struct {
|
typedef struct {
|
||||||
|
|
|
@ -98,17 +98,13 @@ class RestApi {
|
||||||
else if(path == "setup/networks") getNetworks(root);
|
else if(path == "setup/networks") getNetworks(root);
|
||||||
#endif /* !defined(ETHERNET) */
|
#endif /* !defined(ETHERNET) */
|
||||||
else if(path == "live") getLive(request,root);
|
else if(path == "live") getLive(request,root);
|
||||||
/*else if(path == "record/info") getRecord(root, InverterDevInform_All);
|
|
||||||
else if(path == "record/alarm") getRecord(root, AlarmData);
|
|
||||||
else if(path == "record/config") getRecord(root, SystemConfigPara);
|
|
||||||
else if(path == "record/live") getRecord(root, RealTimeRunData_Debug);*/
|
|
||||||
else {
|
else {
|
||||||
if(path.substring(0, 12) == "inverter/id/")
|
if(path.substring(0, 12) == "inverter/id/")
|
||||||
getInverter(root, request->url().substring(17).toInt());
|
getInverter(root, request->url().substring(17).toInt());
|
||||||
else if(path.substring(0, 15) == "inverter/alarm/")
|
else if(path.substring(0, 15) == "inverter/alarm/")
|
||||||
getIvAlarms(root, request->url().substring(20).toInt());
|
getIvAlarms(root, request->url().substring(20).toInt());
|
||||||
else if(path.substring(0, 17) == "inverter/version/")
|
else if(path.substring(0, 17) == "inverter/version/")
|
||||||
getIvVersion(root, request->url().substring(20).toInt());
|
getIvVersion(root, request->url().substring(22).toInt());
|
||||||
else
|
else
|
||||||
getNotFound(root, F("http://") + request->host() + F("/api/"));
|
getNotFound(root, F("http://") + request->host() + F("/api/"));
|
||||||
}
|
}
|
||||||
|
@ -434,21 +430,28 @@ class RestApi {
|
||||||
record_t<> *rec = iv->getRecordStruct(InverterDevInform_Simple);
|
record_t<> *rec = iv->getRecordStruct(InverterDevInform_Simple);
|
||||||
|
|
||||||
obj[F("name")] = String(iv->config->name);
|
obj[F("name")] = String(iv->config->name);
|
||||||
|
obj[F("serial")] = String(iv->config->serial.u64, HEX);
|
||||||
obj[F("generation")] = iv->ivGen;
|
obj[F("generation")] = iv->ivGen;
|
||||||
obj[F("max_pwr")] = iv->getMaxPower();
|
obj[F("max_pwr")] = iv->getMaxPower();
|
||||||
obj[F("part_num")] = iv->getChannelFieldValueInt(CH0, FLD_PART_NUM, rec);
|
obj[F("part_num")] = iv->getChannelFieldValueInt(CH0, FLD_PART_NUM, rec);
|
||||||
obj[F("hw_ver")] = iv->getChannelFieldValueInt(CH0, FLD_HW_VERSION, rec);
|
obj[F("hw_ver")] = iv->getChannelFieldValueInt(CH0, FLD_HW_VERSION, rec);
|
||||||
obj[F("prod_cw")] = ((iv->config->serial.b[3] & 0x0f) * 10 + ((iv->config->serial.b[2] & 0x0f)));
|
obj[F("prod_cw")] = ((iv->config->serial.b[3] & 0x0f) * 10 + (((iv->config->serial.b[2] >> 4) & 0x0f)));
|
||||||
obj[F("prod_year")] = ((iv->config->serial.b[3] >> 4) & 0x0f) + 2014;
|
obj[F("prod_year")] = ((iv->config->serial.b[3] >> 4) & 0x0f) + 2014;
|
||||||
|
|
||||||
|
|
||||||
rec = iv->getRecordStruct(InverterDevInform_All);
|
rec = iv->getRecordStruct(InverterDevInform_All);
|
||||||
obj[F("fw_ver")] = iv->getChannelFieldValueInt(CH0, FLD_FW_VERSION, rec);
|
char buf[10];
|
||||||
obj[F("fw_date")] = String(iv->getChannelFieldValueInt(CH0, FLD_FW_BUILD_YEAR, rec))
|
uint16_t val;
|
||||||
+ "-" + String(iv->getChannelFieldValueInt(CH0, FLD_FW_BUILD_MONTH_DAY, rec) / 100)
|
|
||||||
+ "-" + String(iv->getChannelFieldValueInt(CH0, FLD_FW_BUILD_MONTH_DAY, rec) % 100);
|
val = iv->getChannelFieldValueInt(CH0, FLD_FW_BUILD_MONTH_DAY, rec);
|
||||||
obj[F("fw_time")] = String(iv->getChannelFieldValueInt(CH0, FLD_FW_BUILD_HOUR_MINUTE, rec) / 100)
|
snprintf(buf, 10, "-%02d-%02d", (val / 100), (val % 100));
|
||||||
+ ":" + String(iv->getChannelFieldValueInt(CH0, FLD_FW_BUILD_HOUR_MINUTE, rec) % 100);
|
obj[F("fw_date")] = String(iv->getChannelFieldValueInt(CH0, FLD_FW_BUILD_YEAR, rec)) + String(buf);
|
||||||
|
val = iv->getChannelFieldValueInt(CH0, FLD_FW_BUILD_HOUR_MINUTE, rec);
|
||||||
|
snprintf(buf, 10, "%02d:%02d", (val / 100), (val % 100));
|
||||||
|
obj[F("fw_time")] = String(buf);
|
||||||
|
val = iv->getChannelFieldValueInt(CH0, FLD_FW_VERSION, rec);
|
||||||
|
snprintf(buf, 10, "%d.%02d.%02d", (val / 10000), ((val % 10000) / 100), (val % 100));
|
||||||
|
obj[F("fw_ver")] = String(buf);
|
||||||
obj[F("boot_ver")] = iv->getChannelFieldValueInt(CH0, FLD_BOOTLOADER_VER, rec);
|
obj[F("boot_ver")] = iv->getChannelFieldValueInt(CH0, FLD_BOOTLOADER_VER, rec);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
|
@ -17,6 +17,8 @@
|
||||||
--footer-bg: #282828;
|
--footer-bg: #282828;
|
||||||
--modal-bg: #fff;
|
--modal-bg: #fff;
|
||||||
|
|
||||||
|
--invalid-bg: #f99;
|
||||||
|
|
||||||
--total-head-title: #8e5903;
|
--total-head-title: #8e5903;
|
||||||
--total-bg: #b06e04;
|
--total-bg: #b06e04;
|
||||||
--iv-head-title: #1c6800;
|
--iv-head-title: #1c6800;
|
||||||
|
|
|
@ -17,6 +17,8 @@
|
||||||
--footer-bg: #282828;
|
--footer-bg: #282828;
|
||||||
--modal-bg: #666;
|
--modal-bg: #666;
|
||||||
|
|
||||||
|
--invalid-bg: #400;
|
||||||
|
|
||||||
--total-head-title: #555511;
|
--total-head-title: #555511;
|
||||||
--total-bg: #666622;
|
--total-bg: #666622;
|
||||||
--iv-head-title: #115511;
|
--iv-head-title: #115511;
|
||||||
|
|
|
@ -501,7 +501,7 @@ input[type=text], input[type=password], select, input[type=number] {
|
||||||
|
|
||||||
input:invalid {
|
input:invalid {
|
||||||
border: 2px solid #f00 !important;
|
border: 2px solid #f00 !important;
|
||||||
background-color: #400 !important;
|
background-color: var(--invalid-bg) !important;
|
||||||
}
|
}
|
||||||
|
|
||||||
input.sh {
|
input.sh {
|
||||||
|
|
|
@ -261,7 +261,7 @@
|
||||||
case 3: model = "HMT-"; break;
|
case 3: model = "HMT-"; break;
|
||||||
default: model = "???-"; break;
|
default: model = "???-"; break;
|
||||||
}
|
}
|
||||||
model += String(obj.max_pwr);
|
model += String(obj.max_pwr) + " (Serial: " + obj.serial + ")";
|
||||||
|
|
||||||
|
|
||||||
var html = ml("table", {class: "table"}, [
|
var html = ml("table", {class: "table"}, [
|
||||||
|
@ -276,15 +276,15 @@
|
||||||
]),
|
]),
|
||||||
ml("tr", {}, [
|
ml("tr", {}, [
|
||||||
ml("th", {}, "Hardware Version / Build"),
|
ml("th", {}, "Hardware Version / Build"),
|
||||||
ml("td", {}, String(obj.hw_ver) + " (build: " + String(obj.prod_cw) + "/" + String(obj.prod_year) + ")")
|
ml("td", {}, (obj.hw_ver.toString(16) / 100).toFixed(2) + " (build: " + String(obj.prod_cw) + "/" + String(obj.prod_year) + ")")
|
||||||
]),
|
]),
|
||||||
ml("tr", {}, [
|
ml("tr", {}, [
|
||||||
ml("th", {}, "Hardware Number"),
|
ml("th", {}, "Hardware Number"),
|
||||||
ml("td", {}, String(obj.part_num))
|
ml("td", {}, obj.part_num.toString(16))
|
||||||
]),
|
]),
|
||||||
ml("tr", {}, [
|
ml("tr", {}, [
|
||||||
ml("th", {}, "Bootloader Version"),
|
ml("th", {}, "Bootloader Version"),
|
||||||
ml("td", {}, String(obj.boot_ver))
|
ml("td", {}, (obj.boot_ver / 100).toFixed(2))
|
||||||
])
|
])
|
||||||
])
|
])
|
||||||
]);
|
]);
|
||||||
|
|
Loading…
Add table
Add a link
Reference in a new issue