mirror of
https://github.com/emsesp/EMS-ESP32.git
synced 2025-12-06 15:59:52 +03:00
fix thermostat dhw commands
This commit is contained in:
@@ -34,8 +34,10 @@ 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_DHW = (1 << 1), // 2 TAG_DHW1 - TAG_DHW4
|
||||
HIDDEN = (1 << 3), // 8 do not show in API or Web
|
||||
ADMIN_ONLY = (1 << 4) // 16 requires authentication
|
||||
MQTT_SUB_FLAG_AHS = (1 << 2), // 4 TAG_DEVICE_DATA_AHS
|
||||
MQTT_SUB_FLAG_HS = (1 << 3), // 8 TAG_DEVICE_DATA_HS
|
||||
HIDDEN = (1 << 6), // 64 do not show in API or Web
|
||||
ADMIN_ONLY = (1 << 7) // 128 requires authentication
|
||||
|
||||
};
|
||||
|
||||
@@ -49,6 +51,8 @@ enum CommandRet : uint8_t {
|
||||
INVALID // 5 - invalid (tag)
|
||||
};
|
||||
|
||||
MAKE_ENUM_FIXED(cmdRet, "fail", "ok", "not found", "error", "not allowed", "invalid")
|
||||
|
||||
using cmd_function_p = std::function<bool(const char * data, const int8_t id)>;
|
||||
using cmd_json_function_p = std::function<bool(const char * data, const int8_t id, JsonObject output)>;
|
||||
|
||||
@@ -123,7 +127,7 @@ class Command {
|
||||
uint8_t flags = CommandFlag::MQTT_SUB_FLAG_DEFAULT);
|
||||
|
||||
static void show_all(uuid::console::Shell & shell);
|
||||
static Command::CmdFunction * find_command(const uint8_t device_type, const uint8_t device_id, const char * cmd);
|
||||
static Command::CmdFunction * find_command(const uint8_t device_type, const uint8_t device_id, const char * cmd, const uint8_t flag);
|
||||
|
||||
static void erase_command(const uint8_t device_type, const char * cmd);
|
||||
static void show(uuid::console::Shell & shell, uint8_t device_type, bool verbose);
|
||||
|
||||
Reference in New Issue
Block a user