Skip to content

Commit

Permalink
[Luxtronik] Fix possible out ouf bound error for older heatpumps (ope…
Browse files Browse the repository at this point in the history
…nhab#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>
  • Loading branch information
sgiehl authored and frederictobiasc committed Oct 26, 2021
1 parent 92de93c commit 222556b
Showing 1 changed file with 1 addition and 1 deletion.
Original file line number Diff line number Diff line change
Expand Up @@ -71,7 +71,7 @@ public void read() throws UnknownHostException, IOException {
// 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;
}
}
Expand Down

0 comments on commit 222556b

Please sign in to comment.