Skip to content

Commit

Permalink
idle also counts as state change
Browse files Browse the repository at this point in the history
  • Loading branch information
netmindz committed Oct 2, 2024
1 parent 207acaf commit 6fbc09d
Showing 1 changed file with 6 additions and 4 deletions.
10 changes: 6 additions & 4 deletions sensor/src/sensor.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -808,12 +808,12 @@ void handleMessage(size_t len, uint8_t buf[]) {
String cmd = result.substring(34, 44);
if (cmd == "0000000000") {
// none
} else if (cmd.substring(0, 4) == "01") {
} else if (cmd.substring(0, 2) == "01") {
state = "Temp Up";
} else if (cmd.substring(0, 4) == "02") {
} else if (cmd.substring(0, 2) == "02") {
state = "Temp Down";
} else {
telnetSend("CMD: " + cmd);
telnetSend("Unknown CMD: " + cmd);
}
if (!lastRaw3.equals(cmd)) {
// Controller responded to command
Expand All @@ -826,9 +826,11 @@ void handleMessage(size_t len, uint8_t buf[]) {
}
}

if (!lastRaw3.equals(cmd) && cmd != "0000000000") { // ignore idle command
if (!lastRaw3.equals(cmd)) {
lastRaw3 = cmd;
rawData3.setValue(lastRaw3.c_str());
// telnetSend("CMD state: " + state);
// telnetSend("CMD: " + cmd);
}

if (result.substring(10, 12) == "43" || result.substring(10, 12) == "46") { // "C" or "F"
Expand Down

0 comments on commit 6fbc09d

Please sign in to comment.