only show heating circuit in cmd for thermostats and mixers

This commit is contained in:
proddy
2020-08-03 23:31:08 +02:00
parent 6154ff38f2
commit 725d63a518
3 changed files with 10 additions and 3 deletions

View File

@@ -160,7 +160,7 @@ class Boiler : public EMSdevice {
void check_active(); 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_mode(const char * value, const int8_t id);
void set_warmwater_activated(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); void set_tapwarmwater_activated(const char * value, const int8_t id);

View File

@@ -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 // 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) { 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( EMSESPShell::commands->add_command(
context, context,
CommandFlags::ADMIN, CommandFlags::ADMIN,
flash_string_vector{F_(call)}, 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) { [&](Shell & shell, const std::vector<std::string> & arguments) {
uint8_t device_type_ = device_type(); uint8_t device_type_ = device_type();
if (arguments.empty()) { if (arguments.empty()) {

View File

@@ -102,7 +102,6 @@ MAKE_PSTR(asterisks, "********")
MAKE_PSTR(n_mandatory, "<n>") MAKE_PSTR(n_mandatory, "<n>")
MAKE_PSTR(n_optional, "[n]") MAKE_PSTR(n_optional, "[n]")
MAKE_PSTR(data_optional, "[data]") MAKE_PSTR(data_optional, "[data]")
MAKE_PSTR(id_optional, "[id]")
MAKE_PSTR(typeid_mandatory, "<type ID>") MAKE_PSTR(typeid_mandatory, "<type ID>")
MAKE_PSTR(deviceid_mandatory, "<device ID>") MAKE_PSTR(deviceid_mandatory, "<device ID>")
MAKE_PSTR(deviceid_optional, "[device ID]") MAKE_PSTR(deviceid_optional, "[device ID]")