diff --git a/src/mqtt.cpp b/src/mqtt.cpp index 1b084f4..42b4c9f 100644 --- a/src/mqtt.cpp +++ b/src/mqtt.cpp @@ -23,7 +23,7 @@ void mqtt_callback(char* original_topic, byte* pl, unsigned int length) { pl[length] = '\0'; String payload((char*)pl); String topic (original_topic); - if (topic.compareTo(MQTT_TOPIC "log")==0 || topic.compareTo(MQTT_TOPIC "status") || topic.compareTo(MQTT_TOPIC "metrics")) { + if (topic.equals(MQTT_TOPIC "log") || topic.equals(MQTT_TOPIC "status") || topic.equals(MQTT_TOPIC "metrics")) { // Return our own messages return; }