don't create MQTT commands if MQTT disabled

This commit is contained in:
proddy
2020-11-14 11:44:08 +01:00
parent 18d8d223fb
commit 808ef71c0e

View File

@@ -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) {