From b2eaca27ded38e03c851cc157435c850cbfd3289 Mon Sep 17 00:00:00 2001 From: MichaelDvP Date: Wed, 16 Feb 2022 18:58:45 +0100 Subject: [PATCH] remove unused flag --- src/command.cpp | 3 +-- src/command.h | 7 +++---- 2 files changed, 4 insertions(+), 6 deletions(-) diff --git a/src/command.cpp b/src/command.cpp index 6164134ed..0efece5cd 100644 --- a/src/command.cpp +++ b/src/command.cpp @@ -317,14 +317,13 @@ void Command::add(const uint8_t device_type, const __FlashStringHelper * cmd, co } // add a command to the list, which does return a json object as output -// flag is fixed to MqttSubFlag::MQTT_SUB_FLAG_NOSUB so there will be no topic subscribed to this void Command::add(const uint8_t device_type, const __FlashStringHelper * cmd, const cmd_json_function_p cb, const __FlashStringHelper * description, uint8_t flags) { // if the command already exists for that device type don't add it if (find_command(device_type, read_flash_string(cmd).c_str()) != nullptr) { return; } - cmdfunctions_.emplace_back(device_type, (CommandFlag::MQTT_SUB_FLAG_NOSUB | flags), cmd, nullptr, cb, description); // callback for json is included + cmdfunctions_.emplace_back(device_type, flags, cmd, nullptr, cb, description); // callback for json is included } // see if a command exists for that device type diff --git a/src/command.h b/src/command.h index 6889be6c5..bc1bf7e7c 100644 --- a/src/command.h +++ b/src/command.h @@ -32,10 +32,9 @@ enum CommandFlag : uint8_t { MQTT_SUB_FLAG_DEFAULT = 0, // 0 no flags set, always subscribe to MQTT MQTT_SUB_FLAG_HC = (1 << 0), // 1 TAG_HC1 - TAG_HC8 MQTT_SUB_FLAG_WWC = (1 << 1), // 2 TAG_WWC1 - TAG_WWC4 - MQTT_SUB_FLAG_NOSUB = (1 << 2), // 4 - MQTT_SUB_FLAG_WW = (1 << 3), // 8 TAG_DEVICE_DATA_WW - HIDDEN = (1 << 4), // 16 do not show in API or Web - ADMIN_ONLY = (1 << 5) // 32 requires authentication + MQTT_SUB_FLAG_WW = (1 << 2), // 4 TAG_DEVICE_DATA_WW + HIDDEN = (1 << 3), // 8 do not show in API or Web + ADMIN_ONLY = (1 << 4) // 16 requires authentication };