mirror of
https://github.com/lumapu/ahoy.git
synced 2025-05-11 07:56:39 +02:00
0.8.92
* fix read back of limit value, now with one decimal place
This commit is contained in:
parent
7b030a39d5
commit
3dd1b4e73b
7 changed files with 12 additions and 4 deletions
|
@ -1,5 +1,8 @@
|
|||
# Development Changes
|
||||
|
||||
## 0.8.92 - 2024-03-10
|
||||
* fix read back of limit value, now with one decimal place
|
||||
|
||||
## 0.8.91 - 2024-03-05
|
||||
* fix javascript issues #1480
|
||||
|
||||
|
|
|
@ -13,7 +13,7 @@
|
|||
//-------------------------------------
|
||||
#define VERSION_MAJOR 0
|
||||
#define VERSION_MINOR 8
|
||||
#define VERSION_PATCH 91
|
||||
#define VERSION_PATCH 92
|
||||
|
||||
//-------------------------------------
|
||||
typedef struct {
|
||||
|
|
|
@ -335,7 +335,7 @@ class Inverter {
|
|||
// eg. hw version ...
|
||||
} else if (rec->assign == SystemConfigParaAssignment) {
|
||||
DPRINTLN(DBG_DEBUG, "add config");
|
||||
if (getPosByChFld(0, FLD_ACT_ACTIVE_PWR_LIMIT, rec) == pos){
|
||||
if (getPosByChFld(0, FLD_ACT_ACTIVE_PWR_LIMIT, rec) == pos) {
|
||||
actPowerLimit = rec->record[pos];
|
||||
DPRINT(DBG_DEBUG, F("Inverter actual power limit: "));
|
||||
DPRINTLN(DBG_DEBUG, String(actPowerLimit, 1));
|
||||
|
|
|
@ -28,6 +28,10 @@ namespace ah {
|
|||
snprintf(str, 16, "%d.%d.%d.%d", ip[0], ip[1], ip[2], ip[3]);
|
||||
}
|
||||
|
||||
double round1(double value) {
|
||||
return (int)(value * 10 + 0.5) / 10.0;
|
||||
}
|
||||
|
||||
double round3(double value) {
|
||||
return (int)(value * 1000 + 0.5) / 1000.0;
|
||||
}
|
||||
|
|
|
@ -39,6 +39,7 @@ static Timezone gTimezone(CEST, CET);
|
|||
namespace ah {
|
||||
void ip2Arr(uint8_t ip[], const char *ipStr);
|
||||
void ip2Char(uint8_t ip[], char *str);
|
||||
double round1(double value);
|
||||
double round3(double value);
|
||||
String getDateTimeStr(time_t t);
|
||||
String getDateTimeStrShort(time_t t);
|
||||
|
|
|
@ -499,7 +499,7 @@ class RestApi {
|
|||
obj[F("name")] = String(iv->config->name);
|
||||
obj[F("serial")] = String(iv->config->serial.u64, HEX);
|
||||
obj[F("version")] = String(iv->getFwVersion());
|
||||
obj[F("power_limit_read")] = iv->actPowerLimit;
|
||||
obj[F("power_limit_read")] = ah::round1(iv->getChannelFieldValue(CH0, FLD_ACT_ACTIVE_PWR_LIMIT, iv->getRecordStruct(SystemConfigPara)));
|
||||
obj[F("power_limit_ack")] = iv->powerLimitAck;
|
||||
obj[F("max_pwr")] = iv->getMaxPower();
|
||||
obj[F("ts_last_success")] = rec->ts;
|
||||
|
|
|
@ -116,7 +116,7 @@
|
|||
if(65535 != obj.power_limit_read) {
|
||||
pwrLimit = obj.power_limit_read + " %";
|
||||
if(0 != obj.max_pwr)
|
||||
pwrLimit += ", " + Math.round(obj.max_pwr * obj.power_limit_read / 100) + " W";
|
||||
pwrLimit += ", " + (obj.max_pwr * obj.power_limit_read / 100) + " W";
|
||||
}
|
||||
|
||||
var maxAcPwr = toIsoDateStr(new Date(obj.ts_max_ac_pwr * 1000));
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue