From 6c513140f946872550b4bddf4e837b3e40099a26 Mon Sep 17 00:00:00 2001 From: proddy Date: Mon, 16 Nov 2020 21:16:42 +0100 Subject: [PATCH] auto formatting --- src/devices/boiler.cpp | 4 ++-- src/devices/mixer.cpp | 6 ++++-- src/devices/thermostat.h | 21 ++++++++++++++++++++- 3 files changed, 26 insertions(+), 5 deletions(-) diff --git a/src/devices/boiler.cpp b/src/devices/boiler.cpp index ea1a053d0..f6b6b3910 100644 --- a/src/devices/boiler.cpp +++ b/src/devices/boiler.cpp @@ -143,11 +143,11 @@ void Boiler::register_mqtt_ha_config() { // create the config topics for Home Assistant MQTT Discovery // for each of the ww elements void Boiler::register_mqtt_ha_config_ww() { - if (!Mqtt::connected()) { return; } - // ww + + // ww Mqtt::register_mqtt_ha_sensor(nullptr, F_(mqtt_suffix_ww), F_(wWSelTemp), this->device_type(), "wWSelTemp", F_(degrees), F_(iconcruise)); Mqtt::register_mqtt_ha_sensor(nullptr, F_(mqtt_suffix_ww), F_(wWSetTemp), this->device_type(), "wWSetTemp", F_(degrees), F_(icontemperature)); Mqtt::register_mqtt_ha_sensor(nullptr, F_(mqtt_suffix_ww), F_(wWDisinfectionTemp), this->device_type(), "wWDisinfectionTemp", F_(degrees), F_(icontemperature)); diff --git a/src/devices/mixer.cpp b/src/devices/mixer.cpp index b399c9ffa..c95f1a06b 100644 --- a/src/devices/mixer.cpp +++ b/src/devices/mixer.cpp @@ -63,7 +63,8 @@ void Mixer::device_info_web(JsonArray & root) { // fetch the values into a JSON document StaticJsonDocument doc; - JsonObject json = doc.to(); + JsonObject json = doc.to(); + if (!export_values_format(Mqtt::Format::SINGLE, json)) { return; // empty } @@ -102,7 +103,8 @@ void Mixer::show_values(uuid::console::Shell & shell) { // fetch the values into a JSON document StaticJsonDocument doc; - JsonObject json = doc.to(); + JsonObject json = doc.to(); + if (!export_values_format(Mqtt::Format::SINGLE, json)) { return; // empty } diff --git a/src/devices/thermostat.h b/src/devices/thermostat.h index 2e8999a1b..e180f7d1c 100644 --- a/src/devices/thermostat.h +++ b/src/devices/thermostat.h @@ -88,7 +88,26 @@ class Thermostat : public EMSdevice { uint8_t get_mode(uint8_t flags) const; uint8_t get_mode_type(uint8_t flags) const; - enum Mode : uint8_t { UNKNOWN, OFF, MANUAL, AUTO, DAY, NIGHT, HEAT, NOFROST, ECO, HOLIDAY, COMFORT, OFFSET, DESIGN, SUMMER, FLOWOFFSET, MINFLOW, MAXFLOW, ROOMINFLUENCE }; + enum Mode : uint8_t { + UNKNOWN, + OFF, + MANUAL, + AUTO, + DAY, + NIGHT, + HEAT, + NOFROST, + ECO, + HOLIDAY, + COMFORT, + OFFSET, + DESIGN, + SUMMER, + FLOWOFFSET, + MINFLOW, + MAXFLOW, + ROOMINFLUENCE + }; // for sorting based on hc number friend inline bool operator<(const std::shared_ptr & lhs, const std::shared_ptr & rhs) {