mirror of
https://github.com/emsesp/EMS-ESP32.git
synced 2025-12-06 15:59:52 +03:00
fix display of mqtt subscriptions
This commit is contained in:
@@ -225,8 +225,10 @@ void Mqtt::show_mqtt(uuid::console::Shell & shell) {
|
||||
for (const auto & mqtt_subfunction : mqtt_subfunctions_) {
|
||||
shell.printfln(F(" %s/%s"), mqtt_base_.c_str(), mqtt_subfunction.topic_.c_str());
|
||||
}
|
||||
|
||||
// now show the commands...
|
||||
for (const auto & cf : Command::commands()) {
|
||||
if (subscribe_format_ == 2 && cf.has_flags(CommandFlag::MQTT_SUB_FLAG_HC)) {
|
||||
if (subscribe_format_ == Subscribe_Format::INDIVIDUAL_ALL_HC && cf.has_flags(CommandFlag::MQTT_SUB_FLAG_HC)) {
|
||||
shell.printfln(F(" %s/%s/hc1/%s"),
|
||||
mqtt_base_.c_str(),
|
||||
EMSdevice::device_type_2_device_name(cf.device_type_).c_str(),
|
||||
@@ -243,7 +245,7 @@ void Mqtt::show_mqtt(uuid::console::Shell & shell) {
|
||||
mqtt_base_.c_str(),
|
||||
EMSdevice::device_type_2_device_name(cf.device_type_).c_str(),
|
||||
uuid::read_flash_string(cf.cmd_).c_str());
|
||||
} else if (subscribe_format_ == 1 && !cf.has_flags(CommandFlag::MQTT_SUB_FLAG_NOSUB)) {
|
||||
} else if (subscribe_format_ != Subscribe_Format::GENERAL && !cf.has_flags(CommandFlag::MQTT_SUB_FLAG_NOSUB)) {
|
||||
shell.printfln(F(" %s/%s/%s"),
|
||||
mqtt_base_.c_str(),
|
||||
EMSdevice::device_type_2_device_name(cf.device_type_).c_str(),
|
||||
|
||||
@@ -474,7 +474,8 @@ void Test::run_test(uuid::console::Shell & shell, const std::string & cmd) {
|
||||
if (command == "mqtt_individual") {
|
||||
shell.printfln(F("Testing individual MQTT"));
|
||||
Mqtt::ha_enabled(false); // turn off HA Discovery to stop the chatter
|
||||
Mqtt::subscribe_format(1); // individual topics
|
||||
Mqtt::subscribe_format(2); // individual topics, all HC
|
||||
// Mqtt::subscribe_format(1); // individual topics, only main HC
|
||||
|
||||
run_test("boiler");
|
||||
run_test("thermostat");
|
||||
|
||||
@@ -39,9 +39,9 @@ namespace emsesp {
|
||||
// #define EMSESP_DEBUG_DEFAULT "shower_alert"
|
||||
// #define EMSESP_DEBUG_DEFAULT "310"
|
||||
// #define EMSESP_DEBUG_DEFAULT "render"
|
||||
#define EMSESP_DEBUG_DEFAULT "api"
|
||||
// #define EMSESP_DEBUG_DEFAULT "api"
|
||||
// #define EMSESP_DEBUG_DEFAULT "crash"
|
||||
// #define EMSESP_DEBUG_DEFAULT "mqtt_individual"
|
||||
#define EMSESP_DEBUG_DEFAULT "mqtt_individual"
|
||||
|
||||
class Test {
|
||||
public:
|
||||
|
||||
Reference in New Issue
Block a user