SmartThings Shield data handler (receives configuration data from ST - polling interval, and adjusts on the fly)
| 60 | |
| 61 | //SmartThings Shield data handler (receives configuration data from ST - polling interval, and adjusts on the fly) |
| 62 | void PS_Water::beSmart(const String &str) |
| 63 | { |
| 64 | String s = str.substring(str.indexOf(' ') + 1); |
| 65 | |
| 66 | if (s.toInt() != 0) { |
| 67 | st::PollingSensor::setInterval(s.toInt() * 1000); |
| 68 | if (st::PollingSensor::debug) { |
| 69 | Serial.print(F("PS_Water::beSmart set polling interval to ")); |
| 70 | Serial.println(s.toInt()); |
| 71 | } |
| 72 | } |
| 73 | else { |
| 74 | if (st::PollingSensor::debug) |
| 75 | { |
| 76 | Serial.print(F("PS_Water::beSmart cannot convert ")); |
| 77 | Serial.print(s); |
| 78 | Serial.println(F(" to an Integer.")); |
| 79 | } |
| 80 | } |
| 81 | } |
| 82 | |
| 83 | //function to get data from sensor and queue results for transfer to ST Cloud |
| 84 | void PS_Water::getData() |