mirror of
https://github.com/emsesp/EMS-ESP32.git
synced 2025-12-07 00:09:51 +03:00
mqtt subscriptions include device #173
This commit is contained in:
@@ -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); },
|
[device_type](const char * value, const int8_t id, JsonObject & output) { return command_entities(device_type, output, id); },
|
||||||
F_(entities_cmd));
|
F_(entities_cmd));
|
||||||
|
|
||||||
// MQTT subscribe to the device top-level, e.g. "ems-esp/boiler/#"
|
// 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) + "/#";
|
std::string topic = EMSdevice::device_type_2_device_name(device_type) + "#";
|
||||||
Mqtt::subscribe(device_type, topic, nullptr); // use empty function callback
|
Mqtt::subscribe(device_type, topic, nullptr); // use empty function callback
|
||||||
|
|
||||||
// Print to LOG showing we've added a new device
|
// Print to LOG showing we've added a new device
|
||||||
|
|||||||
@@ -699,8 +699,8 @@ void System::commands_init() {
|
|||||||
Command::add(EMSdevice::DeviceType::SYSTEM, F("test"), System::command_test, F("run tests"));
|
Command::add(EMSdevice::DeviceType::SYSTEM, F("test"), System::command_test, F("run tests"));
|
||||||
#endif
|
#endif
|
||||||
|
|
||||||
// MQTT subscribe "ems-esp/system/#"
|
// MQTT subscribe "ems-esp/system" and subs
|
||||||
Mqtt::subscribe(EMSdevice::DeviceType::SYSTEM, "system/#", nullptr); // use empty function callback
|
Mqtt::subscribe(EMSdevice::DeviceType::SYSTEM, "system#", nullptr); // use empty function callback
|
||||||
}
|
}
|
||||||
|
|
||||||
// flashes the LED
|
// flashes the LED
|
||||||
|
|||||||
Reference in New Issue
Block a user