auto formatting

This commit is contained in:
proddy
2021-05-06 10:10:20 +02:00
parent 7f52ef8bd8
commit 3c1b30a5e4
4 changed files with 7 additions and 7 deletions

View File

@@ -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<char *>()) {
if (data.is<const char *>()) {
ok = Command::call(device_type, cmd, data.as<const char *>());
} else if (data.is<int>()) {
ok = Command::call(device_type, cmd, Helpers::render_value(s, data.as<int16_t>(), 0));

View File

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

View File

@@ -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<char *>()) {
shell.print(data.as<char *>());
if (data.is<const char *>()) {
shell.print(data.as<const char *>());
} else if (data.is<int>()) {
shell.print(data.as<int>());
} else if (data.is<float>()) {
@@ -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;
}

View File

@@ -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<char *>()) {
cmd_known = Command::call(mf.device_type_, command, data.as<char *>(), n);
if (data.is<const char *>()) {
cmd_known = Command::call(mf.device_type_, command, data.as<const char *>(), n);
} else if (data.is<int>()) {
char data_str[10];
cmd_known = Command::call(mf.device_type_, command, Helpers::itoa(data_str, (int16_t)data.as<int>()), n);