From b9e80ad5d81547d3bbd719f3b15284cad8825776 Mon Sep 17 00:00:00 2001 From: proddy Date: Wed, 3 Jun 2020 18:49:31 +0200 Subject: [PATCH] merged with michael's changes - https://github.com/proddy/EMS-ESP/pull/393 --- src/boiler.cpp | 2 +- src/emsesp.cpp | 1 - src/emsesp.h | 1 - src/sensors.h | 2 +- src/thermostat.cpp | 17 ++++++++--------- src/version.h | 2 +- 6 files changed, 11 insertions(+), 14 deletions(-) diff --git a/src/boiler.cpp b/src/boiler.cpp index 6b11f8b28..d6edcb6c8 100644 --- a/src/boiler.cpp +++ b/src/boiler.cpp @@ -344,7 +344,7 @@ void Boiler::show_values(uuid::console::Shell & shell) { } print_value(shell, 2, F("Warm Water activated"), Helpers::render_value(buffer, wWActivated_, EMS_VALUE_BOOL)); - print_value(shell, 2, F("Warm Water charging type"), wWCircPumpType_ ? "3-way valve" : "charge pump"); + print_value(shell, 2, F("Warm Water charging type"), wWCircPumpType_ ? "3-way valve" : "charge pump"); print_value(shell, 2, F("Warm Water circulation pump available"), Helpers::render_value(buffer, wWCircPump_, EMS_VALUE_BOOL)); if (wWCircPumpMode_ == 7) { print_value(shell, 2, F("Warm Water circulation pump freq"), "continuous"); diff --git a/src/emsesp.cpp b/src/emsesp.cpp index 61791328e..1a081d49c 100644 --- a/src/emsesp.cpp +++ b/src/emsesp.cpp @@ -819,7 +819,6 @@ void EMSESP::loop() { shower_.loop(); // check for shower on/off sensors_.loop(); // this will also send out via MQTT console_.loop(); // telnet/serial console - delay(ESP_DELAY); // some time to WiFi and everything else to catch up, calls yield, and also prevent overheating // force a query on the EMS devices to fetch latest data at a set interval (1 min) if ((uuid::get_uptime() - last_fetch_ > EMS_FETCH_FREQUENCY)) { diff --git a/src/emsesp.h b/src/emsesp.h index b93a5803a..1f5a55861 100644 --- a/src/emsesp.h +++ b/src/emsesp.h @@ -46,7 +46,6 @@ #include "shower.h" #define LOG_TRACE_WATCH_NONE 0 // no watch set -#define ESP_DELAY 1 namespace emsesp { diff --git a/src/sensors.h b/src/sensors.h index f4bf76d91..c8dedf664 100644 --- a/src/sensors.h +++ b/src/sensors.h @@ -69,7 +69,7 @@ class Sensors { #ifdef WEMOS_D1_32 static constexpr uint8_t SENSOR_GPIO = 18; // Wemos D1-32 for compatibility D5 #else - static constexpr uint8_t SENSOR_GPIO = 14; + static constexpr uint8_t SENSOR_GPIO = 14; // D5 is LED on wemos lolin D32, so use GPIO14 #endif #endif diff --git a/src/thermostat.cpp b/src/thermostat.cpp index 1fafff48b..edb177398 100644 --- a/src/thermostat.cpp +++ b/src/thermostat.cpp @@ -1456,15 +1456,14 @@ void Thermostat::console_commands(Shell & shell, unsigned int context) { EMSESPShell::commands->add_command(ShellContext::THERMOSTAT, CommandFlags::ADMIN, flash_string_vector{F_(change), F_(temp)}, - flash_string_vector{F_(degrees_mandatory), F_(hc_optional),F_(mode_optional)}, + flash_string_vector{F_(degrees_mandatory), F_(hc_optional), F_(mode_optional)}, [=](Shell & shell __attribute__((unused)), const std::vector & arguments) { - uint8_t hc = (arguments.size() >= 2) ? arguments[1].at(0) - '0' : DEFAULT_HEATING_CIRCUIT; - if ((arguments.size() == 3)) { - set_temperature(atof(arguments.front().c_str()), arguments.back().c_str(), hc); - } else { - set_temperature(atof(arguments.front().c_str()), HeatingCircuit::Mode::AUTO, hc); - } - + uint8_t hc = (arguments.size() >= 2) ? arguments[1].at(0) - '0' : DEFAULT_HEATING_CIRCUIT; + if ((arguments.size() == 3)) { + set_temperature(atof(arguments.front().c_str()), arguments.back().c_str(), hc); + } else { + set_temperature(atof(arguments.front().c_str()), HeatingCircuit::Mode::AUTO, hc); + } }); EMSESPShell::commands->add_command( @@ -1473,7 +1472,7 @@ void Thermostat::console_commands(Shell & shell, unsigned int context) { flash_string_vector{F_(change), F_(mode)}, flash_string_vector{F_(mode_mandatory), F_(hc_optional)}, [=](Shell & shell __attribute__((unused)), const std::vector & arguments) { - uint8_t hc = (arguments.size() == 2) ? arguments[1].at(0) - '0' : DEFAULT_HEATING_CIRCUIT; + uint8_t hc = (arguments.size() == 2) ? arguments[1].at(0) - '0' : DEFAULT_HEATING_CIRCUIT; set_mode(arguments.front(), hc); }, [](Shell & shell __attribute__((unused)), const std::vector & arguments __attribute__((unused))) -> const std::vector { diff --git a/src/version.h b/src/version.h index efc44d9a0..c9d3820dd 100644 --- a/src/version.h +++ b/src/version.h @@ -1 +1 @@ -#define EMSESP_APP_VERSION "2.0.0a12" +#define EMSESP_APP_VERSION "2.0.0a13"