mirror of
https://github.com/emsesp/EMS-ESP32.git
synced 2025-12-07 00:09:51 +03:00
only show heating circuit in cmd for thermostats and mixers
This commit is contained in:
@@ -160,7 +160,7 @@ class Boiler : public EMSdevice {
|
||||
|
||||
void check_active();
|
||||
|
||||
// commands
|
||||
// commands - none of these use the additional id parameter
|
||||
void set_warmwater_mode(const char * value, const int8_t id);
|
||||
void set_warmwater_activated(const char * value, const int8_t id);
|
||||
void set_tapwarmwater_activated(const char * value, const int8_t id);
|
||||
|
||||
@@ -339,11 +339,19 @@ void EMSdevice::print_value(uuid::console::Shell & shell, uint8_t padding, const
|
||||
|
||||
// given a context, automatically add the commands taken them from the MQTT registry for "<device_type>_cmd" topics
|
||||
void EMSdevice::add_context_commands(unsigned int context) {
|
||||
// if we're adding commands for a thermostat or mixing, then include an additional optional paramter called heating circuit
|
||||
flash_string_vector params;
|
||||
if ((context == ShellContext::THERMOSTAT) || (context == ShellContext::MIXING)) {
|
||||
params = flash_string_vector{F_(cmd_optional), F_(data_optional), F_(hc_optional)};
|
||||
} else {
|
||||
params = flash_string_vector{F_(cmd_optional), F_(data_optional)};
|
||||
}
|
||||
|
||||
EMSESPShell::commands->add_command(
|
||||
context,
|
||||
CommandFlags::ADMIN,
|
||||
flash_string_vector{F_(call)},
|
||||
flash_string_vector{F_(cmd_optional), F_(data_optional), F_(id_optional)},
|
||||
params,
|
||||
[&](Shell & shell, const std::vector<std::string> & arguments) {
|
||||
uint8_t device_type_ = device_type();
|
||||
if (arguments.empty()) {
|
||||
|
||||
@@ -102,7 +102,6 @@ MAKE_PSTR(asterisks, "********")
|
||||
MAKE_PSTR(n_mandatory, "<n>")
|
||||
MAKE_PSTR(n_optional, "[n]")
|
||||
MAKE_PSTR(data_optional, "[data]")
|
||||
MAKE_PSTR(id_optional, "[id]")
|
||||
MAKE_PSTR(typeid_mandatory, "<type ID>")
|
||||
MAKE_PSTR(deviceid_mandatory, "<device ID>")
|
||||
MAKE_PSTR(deviceid_optional, "[device ID]")
|
||||
|
||||
Reference in New Issue
Block a user