From 99228622995a5ea553efebdf8fb382c980586dab Mon Sep 17 00:00:00 2001 From: Gunnar Skjold Date: Sat, 26 Mar 2022 17:47:33 +0100 Subject: [PATCH] Fixed -127 value on last hour of day when we enter CEST --- src/entsoe/EntsoeApi.cpp | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/src/entsoe/EntsoeApi.cpp b/src/entsoe/EntsoeApi.cpp index b8b7fe0c..a7e38990 100644 --- a/src/entsoe/EntsoeApi.cpp +++ b/src/entsoe/EntsoeApi.cpp @@ -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;