bool onPowerState(String deviceId, bool &state)
{
Serial.printf("%s: %s\r\n", deviceId.c_str(), state ? "off" : "on");
int relayPIN = devices[deviceId].relayPIN; // get the relay pin for corresponding device
digitalWrite(relayPIN, !state); // set the new relay state
return true;
}
bool onPowerState(String deviceId, bool &state) { Serial.printf("%s: %s\r\n", deviceId.c_str(), state ? "off" : "on"); int relayPIN = devices[deviceId].relayPIN; // get the relay pin for corresponding device digitalWrite(relayPIN, !state); // set the new relay state return true; }
what should i change in above code?