From 9787d1686fa86639599ce043157ba738180ebfc6 Mon Sep 17 00:00:00 2001 From: proddy Date: Tue, 30 Mar 2021 17:58:49 +0200 Subject: [PATCH] style: auto formatting --- src/console.h | 1 + src/devices/boiler.cpp | 10 +++++----- src/devices/mixer.cpp | 1 - src/devices/thermostat.cpp | 4 ++-- src/emsdevice.h | 14 ++------------ src/mqtt.cpp | 2 +- 6 files changed, 11 insertions(+), 21 deletions(-) diff --git a/src/console.h b/src/console.h index f9e154f35..1ceafd631 100644 --- a/src/console.h +++ b/src/console.h @@ -43,6 +43,7 @@ using uuid::log::Level; #define LOG_NOTICE(...) logger_.notice(__VA_ARGS__) #define LOG_WARNING(...) logger_.warning(__VA_ARGS__) #define LOG_ERROR(...) logger_.err(__VA_ARGS__) + #define MQTT_TOPIC(list_name) (__pstr__##list_name[0]) // clang-format off diff --git a/src/devices/boiler.cpp b/src/devices/boiler.cpp index f1cc62461..c16bb0f15 100644 --- a/src/devices/boiler.cpp +++ b/src/devices/boiler.cpp @@ -274,7 +274,7 @@ void Boiler::check_active(const bool force) { // Boiler(0x08) -> Me(0x0B), UBAParameterWW(0x33), data: 08 FF 30 FB FF 28 FF 07 46 00 00 void Boiler::process_UBAParameterWW(std::shared_ptr telegram) { // has_update(telegram->read_bitvalue(wwEquipt_,0,3)); // 8=boiler has ww - has_update(telegram->read_value(wWActivated_, 1)); // 0xFF means on + has_update(telegram->read_value(wWActivated_, 1)); // 0xFF means on has_update(telegram->read_value(wWSelTemp_, 2)); // has_update(telegram->read_value(wW?_, 3)); // Hyst on (default -5) // has_update(telegram->read_value(wW?_, 4)); // (0xFF) Maybe: Hyst off -1? @@ -282,7 +282,7 @@ void Boiler::process_UBAParameterWW(std::shared_ptr telegram) { has_update(telegram->read_value(wWCircPump_, 6)); // 0xFF means on has_update(telegram->read_value(wWCircMode_, 7)); // 1=1x3min 6=6x3min 7=continuous has_update(telegram->read_value(wWDisinfectionTemp_, 8)); - has_update(telegram->read_value(wWChargeType_, 10)); // 0 = charge pump, 0xff = 3-way valve + has_update(telegram->read_value(wWChargeType_, 10)); // 0 = charge pump, 0xff = 3-way valve telegram->read_value(wWComfort_, 9); if (wWComfort_ == 0x00) { @@ -507,9 +507,9 @@ void Boiler::process_UBAParametersPlus(std::shared_ptr telegram) // 0xEA void Boiler::process_UBAParameterWWPlus(std::shared_ptr telegram) { - has_update(telegram->read_value(wWActivated_, 5)); // 0x01 means on - has_update(telegram->read_value(wWCircPump_, 10)); // 0x01 means yes - has_update(telegram->read_value(wWCircMode_, 11)); // 1=1x3min... 6=6x3min, 7=continuous + has_update(telegram->read_value(wWActivated_, 5)); // 0x01 means on + has_update(telegram->read_value(wWCircPump_, 10)); // 0x01 means yes + has_update(telegram->read_value(wWCircMode_, 11)); // 1=1x3min... 6=6x3min, 7=continuous // has_update(telegram->read_value(wWDisinfectTemp_, 12)); // settings, status in E9 // has_update(telegram->read_value(wWSelTemp_, 6)); // settings, status in E9 } diff --git a/src/devices/mixer.cpp b/src/devices/mixer.cpp index 34315091c..3b9b5c4bd 100644 --- a/src/devices/mixer.cpp +++ b/src/devices/mixer.cpp @@ -162,7 +162,6 @@ void Mixer::process_IPMStatusMessage(std::shared_ptr telegram) { // Mixer IPM - 0x001E Temperature Message in unmixed circuits // in unmixed circuits FlowTemp in 10C is zero, this is the measured flowtemp in header void Mixer::process_IPMTempMessage(std::shared_ptr telegram) { - has_update(telegram->read_value(flowTempVf_, 0)); // TC1, is * 10 } diff --git a/src/devices/thermostat.cpp b/src/devices/thermostat.cpp index 5bece1fea..c020306f4 100644 --- a/src/devices/thermostat.cpp +++ b/src/devices/thermostat.cpp @@ -1343,8 +1343,8 @@ bool Thermostat::set_pause(const char * value, const int8_t id) { // set partymode in hours bool Thermostat::set_party(const char * value, const int8_t id) { - uint8_t hc_num = (id == -1) ? AUTO_HEATING_CIRCUIT : id; - std::shared_ptr hc = heating_circuit(hc_num); + uint8_t hc_num = (id == -1) ? AUTO_HEATING_CIRCUIT : id; + std::shared_ptr hc = heating_circuit(hc_num); if (hc == nullptr) { LOG_WARNING(F("Set party: Heating Circuit %d not found or activated for device ID 0x%02X"), hc_num, device_id()); return false; diff --git a/src/emsdevice.h b/src/emsdevice.h index 575066704..d27daf9ec 100644 --- a/src/emsdevice.h +++ b/src/emsdevice.h @@ -139,12 +139,7 @@ enum DeviceValueTAG : uint8_t { }; // mqtt flags for command subscriptions -enum MqttSubFlag : uint8_t { - FLAG_NORMAL = 0, - FLAG_HC, - FLAG_WWC, - FLAG_NOSUB -}; +enum MqttSubFlag : uint8_t { FLAG_NORMAL = 0, FLAG_HC, FLAG_WWC, FLAG_NOSUB }; class EMSdevice { public: @@ -276,12 +271,7 @@ class EMSdevice { const __FlashStringHelper * full_name, uint8_t uom = DeviceValueUOM::NONE); - void register_device_value(uint8_t tag, - void * value_p, - uint8_t type, - const __FlashStringHelper * const * options, - const __FlashStringHelper * const * name, - uint8_t uom = DeviceValueUOM::NONE); + void register_device_value(uint8_t tag, void * value_p, uint8_t type, const __FlashStringHelper * const * options, const __FlashStringHelper * const * name, uint8_t uom = DeviceValueUOM::NONE); void write_command(const uint16_t type_id, const uint8_t offset, uint8_t * message_data, const uint8_t message_length, const uint16_t validate_typeid); void write_command(const uint16_t type_id, const uint8_t offset, const uint8_t value, const uint16_t validate_typeid); void write_command(const uint16_t type_id, const uint8_t offset, const uint8_t value); diff --git a/src/mqtt.cpp b/src/mqtt.cpp index 853be8a36..f3f7c8804 100644 --- a/src/mqtt.cpp +++ b/src/mqtt.cpp @@ -376,7 +376,7 @@ void Mqtt::on_message(const char * fulltopic, const char * payload, size_t len) } else if (data.isNull()) { DynamicJsonDocument resp(EMSESP_JSON_SIZE_XLARGE_DYN); JsonObject json = resp.to(); - cmd_known = Command::call(mf.device_type_, command, "", n, json); + cmd_known = Command::call(mf.device_type_, command, "", n, json); if (cmd_known && json.size()) { Mqtt::publish(F("response"), resp.as()); }