fix: derive Dreame Vacuum name from device to avoid doubled friendly_name
The Dreame integration names the vacuum entity ' <device name>' (leading space), so HA composes the entity friendly_name as the device name twice (e.g. 'Z10 Pro Z10 Pro'). Derive vacuum_name from the device's name_by_user/name instead, falling back to friendly_name then entity_id. Bump blueprint_version to 1.2.1 and manifest to 2.14.2.
This commit is contained in:
@@ -293,7 +293,7 @@ trigger:
|
||||
variables:
|
||||
# Bumped whenever event-handling logic changes; surfaced in debug output
|
||||
# so users can confirm which revision is running.
|
||||
blueprint_version: "1.2.0"
|
||||
blueprint_version: "1.2.1"
|
||||
|
||||
# ---------------------------------------------------------------------------
|
||||
# Input References
|
||||
@@ -329,7 +329,16 @@ variables:
|
||||
# ---------------------------------------------------------------------------
|
||||
# Vacuum Info
|
||||
# ---------------------------------------------------------------------------
|
||||
vacuum_name: "{{ state_attr(vacuum_entity, 'friendly_name') | default(vacuum_entity) }}"
|
||||
# Prefer the device name (clean, single) over the entity's friendly_name.
|
||||
# The Dreame integration names the vacuum entity " <device name>" (leading
|
||||
# space) which Home Assistant composes into the friendly_name, so
|
||||
# friendly_name renders the device name twice (e.g. "Z10 Pro Z10 Pro").
|
||||
# Use the device's user-set/original name; fall back to friendly_name, then
|
||||
# the entity_id.
|
||||
vacuum_name: >
|
||||
{%- set did = device_id(vacuum_entity) -%}
|
||||
{%- set dname = (device_attr(did, 'name_by_user') or device_attr(did, 'name')) if did else none -%}
|
||||
{{ dname if dname else (state_attr(vacuum_entity, 'friendly_name') | default(vacuum_entity, true)) }}
|
||||
|
||||
# ---------------------------------------------------------------------------
|
||||
# Event Data (flat structure — fields are directly on trigger.event.data)
|
||||
|
||||
+1
-1
@@ -1,3 +1,3 @@
|
||||
{
|
||||
"version": "2.14.1"
|
||||
"version": "2.14.2"
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user