mirror of
https://github.com/emsesp/EMS-ESP32.git
synced 2025-12-07 00:09:51 +03:00
fix console show with empty full name
This commit is contained in:
@@ -1030,14 +1030,11 @@ bool EMSdevice::generate_values(JsonObject & output, const uint8_t tag_filter, c
|
|||||||
|
|
||||||
// check conditions:
|
// check conditions:
|
||||||
// 1. it must have a valid value (state is active)
|
// 1. it must have a valid value (state is active)
|
||||||
// 2. it must have a visible, unless the output_target is MQTT
|
// 2. it must have be visible and have a full name
|
||||||
// 3. it must match the given tag filter or have an empty tag
|
// 3. it must match the given tag filter or have an empty tag
|
||||||
bool conditions = ((tag_filter == DeviceValueTAG::TAG_NONE) || (tag_filter == dv.tag)) && dv.has_state(DeviceValueState::DV_ACTIVE);
|
bool conditions = ((tag_filter == DeviceValueTAG::TAG_NONE) || (tag_filter == dv.tag)) && dv.has_state(DeviceValueState::DV_ACTIVE);
|
||||||
// 4. for MQTT we want to always show the special HA entities (they have an empty fullname)
|
bool visible = dv.has_state(DeviceValueState::DV_VISIBLE) && dv.full_name;
|
||||||
bool visible = ((dv.has_state(DeviceValueState::DV_VISIBLE)) || ((output_target == OUTPUT_TARGET::MQTT) && (!dv.full_name)));
|
if (conditions && visible) {
|
||||||
conditions &= visible;
|
|
||||||
|
|
||||||
if (conditions) {
|
|
||||||
has_values = true; // flagged if we actually have data
|
has_values = true; // flagged if we actually have data
|
||||||
|
|
||||||
// we have a tag if it matches the filter given, and that the tag name is not empty/""
|
// we have a tag if it matches the filter given, and that the tag name is not empty/""
|
||||||
|
|||||||
Reference in New Issue
Block a user