Skip to content

Commit

Permalink
Ignore readings of "85" in MeterW1therm.cpp
Browse files Browse the repository at this point in the history
DS18x20 sensors seem to report the default value of "85" every now and again.
These readings are wrong and should be ignored.
  • Loading branch information
justinotherguy committed Dec 12, 2015
1 parent 8d02349 commit 67f427c
Showing 1 changed file with 6 additions and 2 deletions.
8 changes: 6 additions & 2 deletions src/protocols/MeterW1therm.cpp
Expand Up @@ -76,8 +76,12 @@ bool MeterW1therm::W1sysHWif::readTemp(const std::string &device, double &value)
if (pos) {
pos += 2;
value = atof(pos)/1000;
toret = true;
print(log_finest, "read %f from %s (%s)", "w1t", value, dev.c_str(), pos-2);
if (value == "85") {
print(log_debug, "Read default value of 85 from %s, ignoring", "w1t", dev.c_str(), pos-2);
} else {
toret = true;
print(log_finest, "read %f from %s (%s)", "w1t", value, dev.c_str(), pos-2);
}
}
} else {
print(log_debug, "couldn't read 2nd line from %s", "w1t", dev.c_str());
Expand Down

0 comments on commit 67f427c

Please sign in to comment.