From af2710125ec6ac6b4c1a92e7756a1702ce0abfc7 Mon Sep 17 00:00:00 2001 From: MichaelDvP Date: Wed, 3 Nov 2021 18:41:51 +0100 Subject: [PATCH] mqtt subscriptions include device #173 --- src/emsesp.cpp | 4 ++-- src/system.cpp | 4 ++-- 2 files changed, 4 insertions(+), 4 deletions(-) diff --git a/src/emsesp.cpp b/src/emsesp.cpp index e13bb99af..e7a00a55d 100644 --- a/src/emsesp.cpp +++ b/src/emsesp.cpp @@ -1015,8 +1015,8 @@ bool EMSESP::add_device(const uint8_t device_id, const uint8_t product_id, std:: [device_type](const char * value, const int8_t id, JsonObject & output) { return command_entities(device_type, output, id); }, F_(entities_cmd)); - // MQTT subscribe to the device top-level, e.g. "ems-esp/boiler/#" - std::string topic = EMSdevice::device_type_2_device_name(device_type) + "/#"; + // MQTT subscribe to the device top-level, e.g. "ems-esp/boiler" and subs + std::string topic = EMSdevice::device_type_2_device_name(device_type) + "#"; Mqtt::subscribe(device_type, topic, nullptr); // use empty function callback // Print to LOG showing we've added a new device diff --git a/src/system.cpp b/src/system.cpp index 93498498a..52b1196da 100644 --- a/src/system.cpp +++ b/src/system.cpp @@ -699,8 +699,8 @@ void System::commands_init() { Command::add(EMSdevice::DeviceType::SYSTEM, F("test"), System::command_test, F("run tests")); #endif - // MQTT subscribe "ems-esp/system/#" - Mqtt::subscribe(EMSdevice::DeviceType::SYSTEM, "system/#", nullptr); // use empty function callback + // MQTT subscribe "ems-esp/system" and subs + Mqtt::subscribe(EMSdevice::DeviceType::SYSTEM, "system#", nullptr); // use empty function callback } // flashes the LED