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

Method beSmart

Arduino/libraries/ST_Anything_RCSwitch/EX_RCSwitch.cpp:84–103  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

82 }
83
84 void EX_RCSwitch::beSmart(const String &str)
85 {
86 String s=str.substring(str.indexOf(' ')+1);
87 if (st::Executor::debug) {
88 Serial.print(F("EX_RCSwitch::beSmart s = "));
89 Serial.println(s);
90 }
91 if(s==F("on"))
92 {
93 m_bCurrentState=HIGH;
94 }
95 else if(s==F("off"))
96 {
97 m_bCurrentState=LOW;
98 }
99
100 writeStateToPin();
101
102 Everything::sendSmartString(getName() + " " + (m_bCurrentState == HIGH?F("on"):F("off")));
103 }
104
105 void EX_RCSwitch::refresh()
106 {

Callers

nothing calls this directly

Calls 2

printMethod · 0.80
printlnMethod · 0.80

Tested by

no test coverage detected