From 60a82b896a37346d66b577c7a62f2c5a44481f6e Mon Sep 17 00:00:00 2001 From: Bernd Stellwag Date: Tue, 22 Oct 2024 19:28:39 +0200 Subject: [PATCH] add status topic and publish after sending text to sign --- src/main.cpp | 5 ++++- 1 file changed, 4 insertions(+), 1 deletion(-) diff --git a/src/main.cpp b/src/main.cpp index fbed474..6eeeb30 100644 --- a/src/main.cpp +++ b/src/main.cpp @@ -22,7 +22,8 @@ static SocketServer socketServer; WiFiClient client; Adafruit_MQTT_Client mqtt(&client, AIO_SERVER, AIO_SERVERPORT, AIO_USERNAME, AIO_KEY); -Adafruit_MQTT_Subscribe mqtt_subscribe_topic = Adafruit_MQTT_Subscribe(&mqtt, "homeassistant/marquee_sign/text"); +Adafruit_MQTT_Subscribe mqtt_subscribe_topic = Adafruit_MQTT_Subscribe(&mqtt, "homeassistant/marquee_sign/text/set"); +Adafruit_MQTT_Publish mqtt_publish_topic = Adafruit_MQTT_Publish(&mqtt, "homeassistant/marquee_sign/text/status"); void MQTT_connect(); @@ -79,6 +80,8 @@ void loop() { const char* signText = (char *)mqtt_subscribe_topic.lastread; sendTextToSign(signText); + + mqtt_publish_topic.publish(signText); } }