upgrade ha-mqtt to v1.12 that changed path for state and command topics

This commit is contained in:
Nicu Hodos 2025-10-03 10:32:14 +02:00
parent 6edcafe27c
commit 475a58d8a4
2 changed files with 5 additions and 3 deletions

View File

@ -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}}

View File

@ -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