mirror of
https://github.com/emsesp/EMS-ESP32.git
synced 2025-12-07 16:29:51 +03:00
remove useless extra subscriptions #173
This commit is contained in:
@@ -1049,10 +1049,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
|
||||
Mqtt::subscribe(device_type, EMSdevice::device_type_2_device_name(device_type), nullptr); // e.g. "ems-esp/boiler"
|
||||
std::string topic = EMSdevice::device_type_2_device_name(device_type) + "/#";
|
||||
Mqtt::subscribe(device_type, topic, nullptr); // e.g. "ems-esp/boiler/#"
|
||||
// MQTT subscribe to the device e.g. "ems-esp/boiler/#"
|
||||
Mqtt::subscribe(device_type, EMSdevice::device_type_2_device_name(device_type) + "/#", nullptr);
|
||||
|
||||
// Print to LOG showing we've added a new device
|
||||
LOG_INFO(F("Recognized new %s with device ID 0x%02X"), EMSdevice::device_type_2_device_name(device_type).c_str(), device_id);
|
||||
|
||||
Reference in New Issue
Block a user