diff --git a/include/huzzah.h b/include/huzzah.h index 7e76092..6f2ac7d 100644 --- a/include/huzzah.h +++ b/include/huzzah.h @@ -13,6 +13,8 @@ Scheduler ts; #include "wifi.h" #include "webserver.h" +#define RAW_TOPIC MAIN_DEVICE_ID "/raw" + namespace Board { Task tReadCommand(TASK_IMMEDIATE, TASK_FOREVER, [](){ @@ -105,7 +107,7 @@ namespace Board { void publishResponse(JsonDocument& jsonDoc) { char message[255]; serializeJson(jsonDoc, message); - Mqtt::publish("homeassistant/sensor/rc-gateway/raw", message); + Mqtt::publish(RAW_TOPIC, message); if (jsonDoc.containsKey("rcSwitch")) parseSwitches(jsonDoc); if (jsonDoc.containsKey("sensor")) parseSensors(jsonDoc, message); } @@ -113,7 +115,7 @@ namespace Board { void handleJsonError(JsonDocument& jsonError) { char message[255]; serializeJson(jsonError, message); - Mqtt::publish("homeassistant/sensor/rc-gateway/raw", message); + Mqtt::publish(RAW_TOPIC, message); } } // {"rcSwitch":{"protocol":1,"state":false,"group":"11111","channel":4}} \ No newline at end of file diff --git a/platformio.ini b/platformio.ini index f7be12c..f7fb245 100644 --- a/platformio.ini +++ b/platformio.ini @@ -33,7 +33,7 @@ framework = arduino lib_deps = ${env.lib_deps} arkhipenko/TaskScheduler@^3.8.5 - https://git.hodos.ro/libraries/ha-mqtt.git@^1.11.0 + https://git.hodos.ro/libraries/ha-mqtt.git@^1.12.0 https://git.hodos.ro/libraries/wifi.git@^2.0.0 esphome/ESPAsyncWebServer-esphome@^3.4.0 upload_port = 192.168.6.161