Skip to content

Commit

Permalink
fix: prevent infinite loop #174
Browse files Browse the repository at this point in the history
  • Loading branch information
robertsLando committed Jan 11, 2021
1 parent 9f99728 commit 4f31a1b
Showing 1 changed file with 2 additions and 2 deletions.
4 changes: 2 additions & 2 deletions lib/Gateway.js
Original file line number Diff line number Diff line change
Expand Up @@ -1342,12 +1342,12 @@ Gateway.prototype.discoverClimates = function (node) {

// it could happen that mode_map already have defined a mode for this value, in this case
// map that mode to the first one available in the allowed hass modes
const i = 1 // skip 'off'
let i = 1 // skip 'off'
while (
config.discovery_payload.modes.includes(hM) &&
i < allowedModes.length
) {
hM = allowedModes[i]
hM = allowedModes[i++]
}

config.mode_map[hM] = availableModes[m]
Expand Down

0 comments on commit 4f31a1b

Please sign in to comment.