From 808ef71c0e232c886ea6c07d615ca2d367b9ea93 Mon Sep 17 00:00:00 2001 From: proddy Date: Sat, 14 Nov 2020 11:44:08 +0100 Subject: [PATCH] don't create MQTT commands if MQTT disabled --- src/command.cpp | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) diff --git a/src/command.cpp b/src/command.cpp index d2a203f23..f083cee23 100644 --- a/src/command.cpp +++ b/src/command.cpp @@ -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