MCPcopy Create free account
hub / github.com/DanielOgorchock/ST_Anything / beSmart

Method beSmart

Arduino/libraries/ST_Anything/PS_Illuminance.cpp:71–90  ·  view source on GitHub ↗

SmartThings Shield data handler (receives configuration data from ST - polling interval, and adjusts on the fly)

Source from the content-addressed store, hash-verified

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()

Callers

nothing calls this directly

Calls 2

printMethod · 0.80
printlnMethod · 0.80

Tested by

no test coverage detected