Fixed -127 value on last hour of day when we enter CEST

This commit is contained in:
Gunnar Skjold 2022-03-26 17:47:33 +01:00
parent e7fc504975
commit 9922862299

View File

@ -61,7 +61,7 @@ float EntsoeApi::getValueForHour(time_t cur, int8_t hour) {
if(tomorrow == NULL)
return ENTSOE_NO_VALUE;
value = tomorrow->getPoint(pos-24);
if(strcmp(tomorrow->getMeasurementUnit(), "MWH") == 0) {
if(value != ENTSOE_NO_VALUE && strcmp(tomorrow->getMeasurementUnit(), "MWH") == 0) {
multiplier *= 0.001;
} else {
return ENTSOE_NO_VALUE;
@ -73,7 +73,7 @@ float EntsoeApi::getValueForHour(time_t cur, int8_t hour) {
if(today == NULL)
return ENTSOE_NO_VALUE;
value = today->getPoint(pos);
if(strcmp(today->getMeasurementUnit(), "MWH") == 0) {
if(value != ENTSOE_NO_VALUE && strcmp(today->getMeasurementUnit(), "MWH") == 0) {
multiplier *= 0.001;
} else {
return ENTSOE_NO_VALUE;