mirror of
https://github.com/emsesp/EMS-ESP32.git
synced 2025-12-06 15:59:52 +03:00
number format for enum-bool
This commit is contained in:
@@ -626,7 +626,7 @@ bool EMSdevice::generate_values_json(JsonObject & root, const uint8_t tag_filter
|
|||||||
// handle Booleans (true, false)
|
// handle Booleans (true, false)
|
||||||
if ((dv.type == DeviceValueType::BOOL) && Helpers::hasValue(*(uint8_t *)(dv.value_p), EMS_VALUE_BOOL)) {
|
if ((dv.type == DeviceValueType::BOOL) && Helpers::hasValue(*(uint8_t *)(dv.value_p), EMS_VALUE_BOOL)) {
|
||||||
// see if we have options for the bool's
|
// see if we have options for the bool's
|
||||||
if (dv.options_size == 2) {
|
if (dv.options_size == 2 && Mqtt::bool_format() != BOOL_FORMAT_10) {
|
||||||
json[name] = *(uint8_t *)(dv.value_p) ? dv.options[0] : dv.options[1];
|
json[name] = *(uint8_t *)(dv.value_p) ? dv.options[0] : dv.options[1];
|
||||||
has_value = true;
|
has_value = true;
|
||||||
} else {
|
} else {
|
||||||
|
|||||||
Reference in New Issue
Block a user