From 3fe814076beac84a9342dc93ce83b2247e7cb2a3 Mon Sep 17 00:00:00 2001 From: proddy Date: Fri, 4 Sep 2020 13:49:47 +0200 Subject: [PATCH] AUTO_HEATING_CIRCUIT cleanup --- src/devices/thermostat.cpp | 4 ++-- src/devices/thermostat.h | 3 +-- 2 files changed, 3 insertions(+), 4 deletions(-) diff --git a/src/devices/thermostat.cpp b/src/devices/thermostat.cpp index a570bc42c..d0c553de2 100644 --- a/src/devices/thermostat.cpp +++ b/src/devices/thermostat.cpp @@ -467,7 +467,7 @@ void Thermostat::publish_values() { // of nullptr if it doesn't exist yet std::shared_ptr Thermostat::heating_circuit(const uint8_t hc_num) { // if hc_num is 0 then return the first existing hc in the list - if (hc_num == 0) { + if (hc_num == AUTO_HEATING_CIRCUIT) { for (const auto & heating_circuit : heating_circuits_) { return heating_circuit; } @@ -1488,7 +1488,7 @@ void Thermostat::set_mode_n(const uint8_t mode, const uint8_t hc_num) { // get hc based on number std::shared_ptr hc = heating_circuit(hc_num); if (hc == nullptr) { - LOG_WARNING(F("set mode: Heating Circuit %d not found or activated"), hc_num); + LOG_WARNING(F("Set mode: Heating Circuit %d not found or activated"), hc_num); return; } diff --git a/src/devices/thermostat.h b/src/devices/thermostat.h index 78cc80ac0..12da5457c 100644 --- a/src/devices/thermostat.h +++ b/src/devices/thermostat.h @@ -208,8 +208,7 @@ class Thermostat : public EMSdevice { static constexpr uint8_t EMS_OFFSET_JunkersSetMessage2_eco_temp = 6; static constexpr uint8_t EMS_OFFSET_JunkersSetMessage2_heat_temp = 7; -#define AUTO_HEATING_CIRCUIT 0 -#define DEFAULT_HEATING_CIRCUIT 1 + static constexpr uint8_t AUTO_HEATING_CIRCUIT = 0; // Installation settings static constexpr uint8_t EMS_TYPE_IBASettings = 0xA5; // installation settings