[Luxtronik] Fix possible out ouf bound error for older heatpumps (#11318)

* [Luxtronik] Fix possible out ouf bound error for older heatpumps

Signed-off-by: Stefan Giehl <stefangiehl@gmail.com>

* fix typo

Signed-off-by: Stefan Giehl <stefangiehl@gmail.com>
This commit is contained in:
Stefan Giehl
2021-09-29 00:09:34 +02:00
committed by GitHub
parent b35c00c752
commit ff272bc828

View File

@@ -71,7 +71,7 @@ public class HeatpumpConnector {
// the thermal energies can be unreasonably high in some cases, probably due to a sign bug in the firmware
// trying to correct this issue here
for (int i = 151; i <= 154; i++) {
if (heatpumpValues[i] >= 214748364) {
if (heatpumpValues.length > i && heatpumpValues[i] >= 214748364) {
heatpumpValues[i] -= 214748364;
}
}