Signed-off-by: Jan N. Klug <jan.n.klug@rub.de>
This commit is contained in:
J-N-K 2020-11-01 10:47:18 +01:00 committed by GitHub
parent b4bc6d7e77
commit 7850904c71
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
1 changed files with 4 additions and 0 deletions

View File

@ -222,6 +222,10 @@ public class LinkyHandler extends BaseThingHandler {
Consumption result = cachedMonthlyData.getValue(); Consumption result = cachedMonthlyData.getValue();
if (result != null) { if (result != null) {
Aggregate months = result.aggregats.months; Aggregate months = result.aggregats.months;
if (months.datas.size() < 2) {
logger.debug("Received data array too small (required size is 2): {}", months);
return;
}
updateKwhChannel(LAST_MONTH, months.datas.get(0)); updateKwhChannel(LAST_MONTH, months.datas.get(0));
updateKwhChannel(THIS_MONTH, months.datas.get(1)); updateKwhChannel(THIS_MONTH, months.datas.get(1));
} }