Skip to content

Commit

Permalink
Capture additional debug for issue #2
Browse files Browse the repository at this point in the history
  • Loading branch information
thoukydides committed Jan 4, 2020
1 parent ce74e19 commit 6538598
Showing 1 changed file with 9 additions and 1 deletion.
10 changes: 9 additions & 1 deletion has_fan.js
Original file line number Diff line number Diff line change
Expand Up @@ -154,7 +154,15 @@ module.exports = {
// Convert from a program to a rotation speed percentage
toFanSpeedPercent(key) {
let index = this.fanLevels.indexOf(key);
if (index == -1) throw new Error('Unsupported VentingLevel: ' + key);
if (index == -1) {
this.error('Unsupported VentingLevel: ' + key);
this.logIssue(2, {
ventingLevel: key,
fanPrograms: this.fanPrograms,
fanLevels: this.fanLevels
});
index = 0;
}
return index * 100 / (this.fanLevels.length - 1);
}
}

0 comments on commit 6538598

Please sign in to comment.