Merge branch 'master' into mqtt_changes

This commit is contained in:
Gunnar Skjold
2023-11-03 19:57:17 +01:00
7 changed files with 27 additions and 25 deletions

View File

@@ -48,7 +48,7 @@ public:
protected:
RemoteDebug* debugger;
MqttConfig mqttConfig;
MQTTClient mqtt = MQTTClient(128);
MQTTClient mqtt = MQTTClient(256);
unsigned long lastMqttRetry = -10000;
bool caVerification = true;
WiFiClient *mqttClient = NULL;

View File

@@ -89,7 +89,7 @@ float EntsoeApi::getValueForHour(time_t ts, int8_t hour) {
breakTime(tz->toLocal(ts), tm);
hoursToday++;
}
if(pos >= 48)
if(pos > 49)
return ENTSOE_NO_VALUE;
float value = ENTSOE_NO_VALUE;
@@ -286,16 +286,18 @@ float EntsoeApi::getCurrencyMultiplier(const char* from, const char* to, time_t
if(debugger->isActive(RemoteDebug::DEBUG)) debugger->printf_P(PSTR("(EntsoeApi) got exchange rate %.4f\n"), p.getValue());
currencyMultiplier /= p.getValue();
} else {
currencyMultiplier = 0;
return 0;
}
}
} else {
currencyMultiplier = 0;
return 0;
}
if(debugger->isActive(RemoteDebug::DEBUG)) debugger->printf_P(PSTR("(EntsoeApi) Resulting currency multiplier: %.4f\n"), currencyMultiplier);
tmElements_t tm;
breakTime(t, tm);
lastCurrencyFetch = now + (SECS_PER_DAY * 1000) - (((((tm.Hour * 60) + tm.Minute) * 60) + tm.Second) * 1000);
lastCurrencyFetch = now + (SECS_PER_DAY * 1000) - (((((tm.Hour * 60) + tm.Minute) * 60) + tm.Second) * 1000) + 3600000;
}
return currencyMultiplier;
}

View File

@@ -1,7 +1,7 @@
{
"tPI" : %.2f,
"tPO" : %.2f,
"tQI" : %.2f,
"tQO" : %.2f,
"tPI" : %.3f,
"tPO" : %.3f,
"tQI" : %.3f,
"tQO" : %.3f,
"rtc" : %lu
}

View File

@@ -30,10 +30,10 @@
"PF1" : %.2f,
"PF2" : %.2f,
"PF3" : %.2f,
"tPI" : %.2f,
"tPO" : %.2f,
"tQI" : %.2f,
"tQO" : %.2f,
"tPI" : %.3f,
"tPO" : %.3f,
"tQI" : %.3f,
"tQO" : %.3f,
"rtc" : %lu
},
"realtime" : {

File diff suppressed because one or more lines are too long

File diff suppressed because one or more lines are too long

View File

@@ -20,12 +20,12 @@
let values = [];
min = max = 0;
let cur = new Date();
addHours(cur, sysinfo.clock_offset);
addHours(cur, sysinfo.clock_offset - ((24 + cur.getHours() - cur.getUTCHours())%24));
for(i = hour; i<24; i++) {
val = json[zeropad(h++)];
if(val == null) break;
xTicks.push({
label: zeropad(cur.getUTCHours())
label: zeropad(cur.getHours())
});
values.push(val*100);
min = Math.min(min, val*100);
@@ -36,7 +36,7 @@
val = json[zeropad(h++)];
if(val == null) break;
xTicks.push({
label: zeropad(cur.getUTCHours())
label: zeropad(cur.getHours())
});
values.push(val*100);
min = Math.min(min, val*100);