This commit is contained in:
Proddy
2023-01-30 17:14:53 +01:00
parent 7c44f22c45
commit 77a6304fc3
4 changed files with 57 additions and 36 deletions

View File

@@ -1552,10 +1552,7 @@ bool EMSdevice::generate_values(JsonObject & output, const uint8_t tag_filter, c
if (dv.type == DeviceValueType::BOOL && Helpers::hasValue(*(uint8_t *)(dv.value_p), EMS_VALUE_BOOL)) {
// see how to render the value depending on the setting
auto value_b = (bool)*(uint8_t *)(dv.value_p);
if (Mqtt::ha_enabled() && (output_target == OUTPUT_TARGET::MQTT)) {
char s[12];
json[name] = Helpers::render_boolean(s, value_b); // for HA always render as string
} else if (output_target == OUTPUT_TARGET::CONSOLE) {
if (output_target == OUTPUT_TARGET::CONSOLE) {
char s[12];
json[name] = Helpers::render_boolean(s, value_b, true); // console use web settings
} else if (EMSESP::system_.bool_format() == BOOL_FORMAT_TRUEFALSE) {