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