mirror of
https://github.com/emsesp/EMS-ESP32.git
synced 2025-12-07 00:09:51 +03:00
fix: only create mqtt subs for Boiler (expose individual commands via MQTT topics #31)
This commit is contained in:
@@ -108,9 +108,12 @@ void Mqtt::register_command(const uint8_t device_type, const __FlashStringHelper
|
||||
|
||||
// register the individual commands too (e.g. ems-esp/boiler/wwonetime)
|
||||
// https://github.com/emsesp/EMS-ESP32/issues/31
|
||||
std::string topic(100, '\0');
|
||||
topic = cmd_topic + "/" + uuid::read_flash_string(cmd);
|
||||
Mqtt::subscribe(device_type, topic, nullptr);
|
||||
// for now only do this for the boiler
|
||||
if (device_type == EMSdevice::DeviceType::BOILER) {
|
||||
std::string topic(100, '\0');
|
||||
topic = cmd_topic + "/" + uuid::read_flash_string(cmd);
|
||||
Mqtt::subscribe(device_type, topic, nullptr);
|
||||
}
|
||||
}
|
||||
|
||||
// subscribe to an MQTT topic, and store the associated callback function
|
||||
|
||||
Reference in New Issue
Block a user