From 3c1b30a5e436efdd310fc605cbb68790510fd7e4 Mon Sep 17 00:00:00 2001 From: proddy Date: Thu, 6 May 2021 10:10:20 +0200 Subject: [PATCH] auto formatting --- src/WebDevicesService.cpp | 2 +- src/devices/mixer.cpp | 2 +- src/emsesp.cpp | 6 +++--- src/mqtt.cpp | 4 ++-- 4 files changed, 7 insertions(+), 7 deletions(-) diff --git a/src/WebDevicesService.cpp b/src/WebDevicesService.cpp index bf70cc8e3..9301ea5d3 100644 --- a/src/WebDevicesService.cpp +++ b/src/WebDevicesService.cpp @@ -129,7 +129,7 @@ void WebDevicesService::write_value(AsyncWebServerRequest * request, JsonVariant char s[10]; // the data could be in any format, but we need string JsonVariant data = dv["data"]; - if (data.is()) { + if (data.is()) { ok = Command::call(device_type, cmd, data.as()); } else if (data.is()) { ok = Command::call(device_type, cmd, Helpers::render_value(s, data.as(), 0)); diff --git a/src/devices/mixer.cpp b/src/devices/mixer.cpp index dc8f28068..721fa12bc 100644 --- a/src/devices/mixer.cpp +++ b/src/devices/mixer.cpp @@ -100,7 +100,7 @@ bool Mixer::publish_ha_config() { char tpl[30]; if (type_ == Type::HC) { snprintf_P(tpl, sizeof(tpl), PSTR("{{value_json.hc%d.id}}"), device_id() - 0x20 + 1); - } else { + } else { snprintf_P(tpl, sizeof(tpl), PSTR("{{value_json.wwc%d.id}}"), device_id() - 0x28 + 1); } doc["val_tpl"] = tpl; diff --git a/src/emsesp.cpp b/src/emsesp.cpp index 1196b77bc..8849c2609 100644 --- a/src/emsesp.cpp +++ b/src/emsesp.cpp @@ -323,8 +323,8 @@ void EMSESP::show_device_values(uuid::console::Shell & shell) { shell.printf(" %s: ", key); JsonVariant data = p.value(); shell.print(COLOR_BRIGHT_GREEN); - if (data.is()) { - shell.print(data.as()); + if (data.is()) { + shell.print(data.as()); } else if (data.is()) { shell.print(data.as()); } else if (data.is()) { @@ -986,7 +986,7 @@ bool EMSESP::command_info(uint8_t device_type, JsonObject & json, const int8_t i tag = DeviceValueTAG::TAG_WWC1 + id - 9; } else if (id == -1) { tag = DeviceValueTAG::TAG_NONE; - } else { + } else { return false; } diff --git a/src/mqtt.cpp b/src/mqtt.cpp index 3b0df514e..5b79faa7e 100644 --- a/src/mqtt.cpp +++ b/src/mqtt.cpp @@ -387,8 +387,8 @@ void Mqtt::on_message(const char * fulltopic, const char * payload, size_t len) bool cmd_known = false; JsonVariant data = doc["data"]; - if (data.is()) { - cmd_known = Command::call(mf.device_type_, command, data.as(), n); + if (data.is()) { + cmd_known = Command::call(mf.device_type_, command, data.as(), n); } else if (data.is()) { char data_str[10]; cmd_known = Command::call(mf.device_type_, command, Helpers::itoa(data_str, (int16_t)data.as()), n);