Skip to content

Commit 3a63ae6

Browse files
committed
Check if incomming message contains anything.
1 parent 7d50130 commit 3a63ae6

File tree

1 file changed

+1
-1
lines changed

1 file changed

+1
-1
lines changed

libraries/MySensors/examples/RelayWithButtonActuator/RelayWithButtonActuator.ino

+1-1
Original file line numberDiff line numberDiff line change
@@ -70,7 +70,7 @@ void incomingMessage(const MyMessage &message) {
7070
Serial.println("This is an ack from gateway");
7171
}
7272

73-
if (message.type==V_LIGHT) {
73+
if (message.type == V_LIGHT && strlen(msg.getString()) != 0) {
7474
// Change relay state
7575
state = message.getBool();
7676
digitalWrite(RELAY_PIN, state?RELAY_ON:RELAY_OFF);

0 commit comments

Comments
 (0)