Skip to content

Commit

Permalink
Filter change indication fix
Browse files Browse the repository at this point in the history
  • Loading branch information
torandreroland committed Feb 12, 2023
1 parent fe86d64 commit 27afb89
Showing 1 changed file with 1 addition and 1 deletion.
2 changes: 1 addition & 1 deletion index.js
Original file line number Diff line number Diff line change
Expand Up @@ -138,7 +138,7 @@ Ventilation.prototype = {
let responseMonths = await this.client.readHoldingRegisters(this.replacementTimeInMonthsRegister, 1)
let responseDays = await this.client.readHoldingRegisters(this.elapsedDaysSinceFilterChangeRegister, 1)

const respondedFilterChangeIndication = (responseDays.data[0] > this.replacementTimeMonths * 30) ? 1 : 0;
const respondedFilterChangeIndication = (responseDays.data[0] > responseMonths.data[0] * 30) ? 1 : 0;
if (respondedFilterChangeIndication != this.filterChangeIndication) {
this.log("Received updated filterChangeIndication from unit. Changing from %s to %s based on number of days passed: %s.", this.filterChangeIndication, respondedFilterChangeIndication, responseDays.data[0]);
}
Expand Down

0 comments on commit 27afb89

Please sign in to comment.