* [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>
// 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;
}
}