From 0263908e67d774ba95dbefaf98be1a4d10a3f39b Mon Sep 17 00:00:00 2001 From: Marcel Walter Date: Tue, 20 Jan 2026 01:11:47 +0100 Subject: [PATCH] MQTT: fix text object format --- src/main.cpp | 23 +++-------------------- 1 file changed, 3 insertions(+), 20 deletions(-) diff --git a/src/main.cpp b/src/main.cpp index dda2770..e631a9a 100644 --- a/src/main.cpp +++ b/src/main.cpp @@ -264,6 +264,8 @@ void loop() mqtt.publish(FLIPDOT_AVAILABILITY_TOPIC, "available"); publishHomeAssistantDiscovery(); + + publishClose(); } } } @@ -450,25 +452,6 @@ void mqttCallback(char *topic, unsigned char *message, unsigned int length) if (ToppicString == FLIPDOT_TEXT_TOPIC) { Serial.println("Text topic received: " + MessageString); - JsonDocument doc; - if (deserializeJson(doc, (const char *)message, length) == DeserializationError::Ok) - { - MessageString = doc["value"] | String("none"); // the pipe operand tells the default value, if "value" is not existing - - if ((MessageString != "none")) - { - printText(MessageString); - } - else - { - Serial.print(FLIPDOT_TEXT_TOPIC); - Serial.println(" has no [\"value\"]!"); - } - } - else - { - Serial.print(FLIPDOT_TEXT_TOPIC); - Serial.println(" is no json!"); - } + printText(MessageString); } }