automatic formatting

This commit is contained in:
proddy
2020-09-12 16:47:37 +02:00
parent aca7cce98b
commit 796848f2e4
10 changed files with 25 additions and 13 deletions

View File

@@ -30,6 +30,12 @@ class DummySettings {
String jwtSecret = "ems-esp";
String ssid = "ems-esp";
String password = "ems-esp";
uint16_t publish_time_boiler;
uint16_t publish_time_thermostat;
uint16_t publish_time_solar;
uint16_t publish_time_mixing;
uint16_t publish_time_other;
uint16_t publish_time_sensor;
static void read(DummySettings & settings, JsonObject & root){};
static void read(DummySettings & settings){};

View File

@@ -486,8 +486,8 @@ bool EMSESP::process_telegram(std::shared_ptr<const Telegram> 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());
}
}

View File

@@ -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)

View File

@@ -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;

View File

@@ -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());
}
}