| 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 | { |