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 <[email protected]>

* fix typo

Signed-off-by: Stefan Giehl <[email protected]>
Signed-off-by: Dave J Schoepel <[email protected]>
  • Loading branch information
sgiehl authored and dschoepel committed Nov 9, 2021
1 parent 3df766d commit ce357cc
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 ce357cc

Please sign in to comment.