mirror of
https://github.com/emsesp/EMS-ESP32.git
synced 2025-12-06 15:59:52 +03:00
don't create MQTT commands if MQTT disabled
This commit is contained in:
@@ -68,7 +68,9 @@ void Command::add(const uint8_t device_type, const uint8_t device_id, const __Fl
|
||||
cmdfunctions_.emplace_back(device_type, cmd, cb, nullptr);
|
||||
|
||||
// see if we need to subscribe
|
||||
Mqtt::register_command(device_type, device_id, cmd, cb);
|
||||
if (Mqtt::enabled()) {
|
||||
Mqtt::register_command(device_type, device_id, cmd, cb);
|
||||
}
|
||||
}
|
||||
|
||||
// add a command to the list, which does return json object as output
|
||||
|
||||
Reference in New Issue
Block a user