From fdc9b7ebf6b95401166e6ae5b794cce5f0424b5a Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?sondre=20Sj=C3=B8lyst?= Date: Wed, 18 Dec 2024 17:09:56 +0100 Subject: [PATCH] chore: print when clearing devices --- lib/liz | 2 +- src/MQTTHelper.h | 14 +++++++++----- 2 files changed, 10 insertions(+), 6 deletions(-) diff --git a/lib/liz b/lib/liz index 71b0c4f..c399f5d 160000 --- a/lib/liz +++ b/lib/liz @@ -1 +1 @@ -Subproject commit 71b0c4fa5e8c9d820f1a5533f4c7c57c2e9d7cf2 +Subproject commit c399f5dbf99f8ef2e844c2203e250e6cd239e472 diff --git a/src/MQTTHelper.h b/src/MQTTHelper.h index b9718ef..b7f627a 100644 --- a/src/MQTTHelper.h +++ b/src/MQTTHelper.h @@ -233,7 +233,9 @@ bool mqttStatus() void connectToMQTT() { Serial.print("Attempting to connect to MQTT broker: "); - Serial.print(MQTT_BROKER); + Serial.println(MQTT_BROKER); + printHelper.print("Attempting to connect to MQTT broker: "); + printHelper.println(MQTT_BROKER); client.setServer(MQTT_BROKER, MQTT_PORT); client.setBufferSize(512); @@ -241,14 +243,14 @@ void connectToMQTT() while (!client.connected()) { - Serial.print("."); - + liz::clearDiscoveredDevices(); + printHelper.println("Clearing Discovered Devices"); if (client.connect(MQTT_HOSTNAME, MQTT_USER, MQTT_PASS)) { Serial.println(""); Serial.println("MQTT connected"); - - liz::clearDiscoveredDevices(); + printHelper.println(""); + printHelper.println("MQTT connected"); if (strcmp(LIZ_TYPE, "sensor") == 0) { @@ -264,6 +266,8 @@ void connectToMQTT() { Serial.print("MQTT connection failed! Error code = "); Serial.println(client.state()); + printHelper.print("MQTT connection failed! Error code = "); + printHelper.println(String(client.state())); } } }