mirror of
https://github.com/emsesp/EMS-ESP32.git
synced 2025-12-07 08:19:52 +03:00
don't create MQTT commands if MQTT disabled
This commit is contained in:
@@ -68,8 +68,10 @@ 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
|
||||
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
|
||||
void Command::add_with_json(const uint8_t device_type, const __FlashStringHelper * cmd, cmdfunction_json_p cb) {
|
||||
|
||||
Reference in New Issue
Block a user