]> git.basschouten.com Git - openhab-addons.git/commitdiff
[Luxtronik] Fix possible out ouf bound error for older heatpumps (#11318)
authorStefan Giehl <stefangiehl@gmail.com>
Tue, 28 Sep 2021 22:09:34 +0000 (00:09 +0200)
committerGitHub <noreply@github.com>
Tue, 28 Sep 2021 22:09:34 +0000 (00:09 +0200)
* [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>
bundles/org.openhab.binding.luxtronikheatpump/src/main/java/org/openhab/binding/luxtronikheatpump/internal/HeatpumpConnector.java

index a3ed82e6433619d6162362e836a935e60ac10c46..1cfd739a2bab716fa331c28ec271012d953dc47f 100644 (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;
                 }
             }