Skip to content

Commit

Permalink
NoStateChangeOn85C review fixes - change the comparison method for fl…
Browse files Browse the repository at this point in the history
…oat value
  • Loading branch information
CC1337 committed Jan 31, 2020
1 parent b7ea571 commit 4aef4c8
Showing 1 changed file with 1 addition and 1 deletion.
2 changes: 1 addition & 1 deletion main.js
Original file line number Diff line number Diff line change
Expand Up @@ -358,7 +358,7 @@ function readWire(wire) {
// else some float value, e.g. temperature
let val = owfsParseFloat(result.value);
if (!isNaN(val)) {
if (adapter.config.noStateChangeOn85C && val == 85.0) {
if (adapter.config.noStateChangeOn85C && val >= 84.999 && val <= 85.001) {
adapter.log.info('Ignoring 85.0°C value of /' + wire.id + '/' + (wire.property || 'temperature') + ': ' + result.value);
} else {
adapter.setState('wires.' + wire._name, {val: val, ack: true, q: 0});
Expand Down

0 comments on commit 4aef4c8

Please sign in to comment.