x
This commit is contained in:
@@ -51,8 +51,7 @@ void reconnect() {
|
||||
// Attempt to connect
|
||||
if (client.connect(clientId.c_str())) {
|
||||
Serial.println("MQTT connected");
|
||||
client.publish("OLED", "Connected");
|
||||
client.subscribe("Address/Livorno/Garagedoor");
|
||||
client.subscribe("Address/Livorno/Garagedoor",1);
|
||||
} else {
|
||||
Serial.print("MQTT failed, rc=");
|
||||
Serial.print(client.state());
|
||||
@@ -80,6 +79,7 @@ void callback(char* topic, byte* payload, unsigned int length) {
|
||||
Serial.println(theText);
|
||||
|
||||
isOpen=(strncmp(theText,"opened",6)==0);
|
||||
|
||||
Serial.println(isOpen?"CALLBACK: OPEN":"CALLBACK: CLOSED");
|
||||
}
|
||||
|
||||
|
||||
Reference in New Issue
Block a user