diff --git a/Common/Dreame Vacuum/blueprint.yaml b/Common/Dreame Vacuum/blueprint.yaml index a98553e..d6e507f 100644 --- a/Common/Dreame Vacuum/blueprint.yaml +++ b/Common/Dreame Vacuum/blueprint.yaml @@ -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 " " (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) diff --git a/manifest.json b/manifest.json index 7468b8e..059e225 100644 --- a/manifest.json +++ b/manifest.json @@ -1,3 +1,3 @@ { - "version": "2.14.1" + "version": "2.14.2" }