From 796848f2e4669eb6331092cc68f82cbfd69a91fa Mon Sep 17 00:00:00 2001 From: proddy Date: Sat, 12 Sep 2020 16:47:37 +0200 Subject: [PATCH] automatic formatting --- interface/src/project/EMSESPSettingsController.tsx | 2 +- interface/src/project/EMSESPtypes.ts | 6 +++--- lib_standalone/ESP8266React.h | 6 ++++++ src/EMSESPSettingsService.cpp | 2 +- src/devices/mixing.cpp | 2 +- src/devices/thermostat.cpp | 4 ++-- src/emsesp.cpp | 4 ++-- src/sensors.cpp | 5 ++++- src/system.cpp | 2 ++ src/telegram.cpp | 5 +++-- 10 files changed, 25 insertions(+), 13 deletions(-) diff --git a/interface/src/project/EMSESPSettingsController.tsx b/interface/src/project/EMSESPSettingsController.tsx index c8106b748..e5a79952c 100644 --- a/interface/src/project/EMSESPSettingsController.tsx +++ b/interface/src/project/EMSESPSettingsController.tsx @@ -134,7 +134,7 @@ function EMSESPSettingsControllerForm(props: EMSESPSettingsControllerFormProps) LED Settings - doc; - char s[5]; // for formatting strings + char s[5]; // for formatting strings switch (type_) { case Type::HC: diff --git a/src/devices/thermostat.cpp b/src/devices/thermostat.cpp index 4c4eeef37..fb90f8d3b 100644 --- a/src/devices/thermostat.cpp +++ b/src/devices/thermostat.cpp @@ -1630,7 +1630,7 @@ void Thermostat::set_temperature(const float temperature, const uint8_t mode, co break; default: case HeatingCircuit::Mode::AUTO: - offset = 0x08; // auto offset + offset = 0x08; // auto offset validate_typeid = monitor_typeids[hc->hc_num() - 1]; // get setpoint roomtemp back break; } @@ -1678,7 +1678,7 @@ void Thermostat::set_temperature(const float temperature, const uint8_t mode, co factor = 1; break; default: - case HeatingCircuit::Mode::AUTO: // automatic selection, if no type is defined, we use the standard code + case HeatingCircuit::Mode::AUTO: // automatic selection, if no type is defined, we use the standard code validate_typeid = monitor_typeids[hc->hc_num() - 1]; //get setpoint roomtemp back if (model == EMS_DEVICE_FLAG_RC35) { uint8_t mode_ = hc->get_mode(this->flags()); diff --git a/src/emsesp.cpp b/src/emsesp.cpp index e6b4423db..0fa44f27c 100644 --- a/src/emsesp.cpp +++ b/src/emsesp.cpp @@ -486,8 +486,8 @@ bool EMSESP::process_telegram(std::shared_ptr telegram) { LOG_NOTICE(pretty_telegram(telegram).c_str()); read_id_ = WATCH_ID_NONE; } else if (watch() == WATCH_ON) { - if ((watch_id_ == WATCH_ID_NONE) || (telegram->type_id == watch_id_) || - ((watch_id_ < 0x80) && ((telegram->src == watch_id_) || (telegram->dest == watch_id_)))) { + if ((watch_id_ == WATCH_ID_NONE) || (telegram->type_id == watch_id_) + || ((watch_id_ < 0x80) && ((telegram->src == watch_id_) || (telegram->dest == watch_id_)))) { LOG_NOTICE(pretty_telegram(telegram).c_str()); } } diff --git a/src/sensors.cpp b/src/sensors.cpp index e196bbd78..43d9efdcd 100644 --- a/src/sensors.cpp +++ b/src/sensors.cpp @@ -49,7 +49,10 @@ void Sensors::reload() { mqtt_format_ = settings.mqtt_format; // single, nested or ha }); - EMSESP::emsespSettingsService.read([&](EMSESPSettings & settings) { dallas_gpio_ = settings.dallas_gpio; parasite_ = settings.dallas_parasite; }); + EMSESP::emsespSettingsService.read([&](EMSESPSettings & settings) { + dallas_gpio_ = settings.dallas_gpio; + parasite_ = settings.dallas_parasite; + }); if (mqtt_format_ == MQTT_format::HA) { for (uint8_t i = 0; i < MAX_SENSORS; registered_ha_[i++] = false) diff --git a/src/system.cpp b/src/system.cpp index 33e15a5a7..bab8ce199 100644 --- a/src/system.cpp +++ b/src/system.cpp @@ -250,6 +250,8 @@ void System::measure_analog() { uint16_t a = analogRead(A0); #elif defined(ESP32) uint16_t a = analogRead(36); +#else + uint16_t a = 0; // standalone #endif static uint32_t sum_ = 0; diff --git a/src/telegram.cpp b/src/telegram.cpp index 1ef80c54f..031ff33b8 100644 --- a/src/telegram.cpp +++ b/src/telegram.cpp @@ -195,7 +195,8 @@ void RxService::add(uint8_t * data, uint8_t length) { // if we're watching and "raw" print out actual telegram as bytes to the console if (EMSESP::watch() == EMSESP::Watch::WATCH_RAW) { uint16_t trace_watch_id = EMSESP::watch_id(); - if ((trace_watch_id == WATCH_ID_NONE) || (type_id == trace_watch_id) || ((trace_watch_id < 0x80) && ((src == trace_watch_id) || (dest == trace_watch_id)))) { + if ((trace_watch_id == WATCH_ID_NONE) || (type_id == trace_watch_id) + || ((trace_watch_id < 0x80) && ((src == trace_watch_id) || (dest == trace_watch_id)))) { LOG_NOTICE(F("Rx: %s"), Helpers::data_to_hex(data, length).c_str()); } } @@ -583,7 +584,7 @@ uint16_t TxService::post_send_query() { uint16_t post_typeid = this->get_post_send_query(); if (post_typeid) { - uint8_t dest = (this->telegram_last_->dest & 0x7F); + uint8_t dest = (this->telegram_last_->dest & 0x7F); // when set a value with large offset before and validate on same type, we have to add offset 0, 26, 52, ... uint8_t offset = (this->telegram_last_->type_id == post_typeid) ? ((this->telegram_last_->offset / 26) * 26) : 0; uint8_t message_data[1] = {EMS_MAX_TELEGRAM_LENGTH}; // request all data, 32 bytes