From c075d08c769ebbb0e5df7d9e435148c34ea8d22b Mon Sep 17 00:00:00 2001 From: Piotr Machowski Date: Sun, 4 Jun 2023 03:05:04 +0200 Subject: [PATCH 1/4] Fix vacuum_clean_zone_predefined for DeebotUniverse/Deebot-4-Home-Assistant --- .../DeebotUniverse_Deebot-4-Home-Assistant.json | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/model/generators/platform_templates/DeebotUniverse_Deebot-4-Home-Assistant.json b/src/model/generators/platform_templates/DeebotUniverse_Deebot-4-Home-Assistant.json index c5583d0d..69f965ce 100644 --- a/src/model/generators/platform_templates/DeebotUniverse_Deebot-4-Home-Assistant.json +++ b/src/model/generators/platform_templates/DeebotUniverse_Deebot-4-Home-Assistant.json @@ -50,7 +50,7 @@ "coordinates_to_meters_divider": -1, "repeats_type": "NONE", "service_call_schema": { - "service": "xiaomi_miio.vacuum_clean_zone", + "service": "vacuum.send_command", "service_data": { "entity_id": "[[entity_id]]", "command": "custom_area", From 4cb145effa76244e52939f4bde7b7567488b3c54 Mon Sep 17 00:00:00 2001 From: Piotr Machowski Date: Sun, 4 Jun 2023 03:32:11 +0200 Subject: [PATCH 2/4] Fix duplicated units issue --- src/components/tile.ts | 8 ++++++-- 1 file changed, 6 insertions(+), 2 deletions(-) diff --git a/src/components/tile.ts b/src/components/tile.ts index 0dbee0c2..02649333 100644 --- a/src/components/tile.ts +++ b/src/components/tile.ts @@ -94,6 +94,7 @@ export class Tile extends RootlessLitElement { stateObject?: HassEntity, ) { let value: ReplacedKey = ""; + const unit = this.getUnit(); const processNumber = this.config.multiplier !== undefined || this.config.precision !== undefined; if (this.config.entity && stateObject) { if (processNumber) { @@ -101,7 +102,11 @@ export class Tile extends RootlessLitElement { ? stateObject.attributes[this.config.attribute] : stateObject.state; } else { - value = localizeEntity(this.hass, this.config as EntityConfig, this.hass.states[this.config.entity]); + value = localizeEntity(this.hass, this.config as EntityConfig, stateObject); + const originalUnit = stateObject.attributes.unit_of_measurement; + if (unit !== "" && originalUnit && value.endsWith(originalUnit)) { + value = value.substring(0, value.length - originalUnit.length).trimEnd(); + } } } else if (this.config.internal_variable && this.config.internal_variable in this.internalVariables) { value = this.internalVariables[this.config.internal_variable]; @@ -116,7 +121,6 @@ export class Tile extends RootlessLitElement { if (`${value}`.toLowerCase() in translations) { value = translations[`${value}`.toLowerCase()]; } - const unit = this.getUnit(); return `${value}${unit}`; } From 9ccfa61ca21e92774fc1798dca33f9f6195c230b Mon Sep 17 00:00:00 2001 From: Piotr Machowski Date: Mon, 5 Jun 2023 00:29:45 +0200 Subject: [PATCH 3/4] Fix room cleaning in humbertogontijo/homeassistant-roborock platform --- .../humbertogontijo_homeassistant-roborock.json | 5 +++-- 1 file changed, 3 insertions(+), 2 deletions(-) diff --git a/src/model/generators/platform_templates/humbertogontijo_homeassistant-roborock.json b/src/model/generators/platform_templates/humbertogontijo_homeassistant-roborock.json index ee8ef3a5..7de9b638 100644 --- a/src/model/generators/platform_templates/humbertogontijo_homeassistant-roborock.json +++ b/src/model/generators/platform_templates/humbertogontijo_homeassistant-roborock.json @@ -9,13 +9,14 @@ "name": "map_mode.vacuum_clean_segment", "icon": "mdi:floor-plan", "selection_type": "ROOM", - "repeats_type": "REPEAT", + "repeats_type": "EXTERNAL", "max_repeats": 3, "service_call_schema": { "service": "roborock.vacuum_clean_segment", "service_data": { "segments": "[[selection]]", - "entity_id": "[[entity_id]]" + "entity_id": "[[entity_id]]", + "repeats": "[[repeats]]" } } }, From 965cf8c90cfd9bb2cecd8b53cfc75c94dd4ac5e5 Mon Sep 17 00:00:00 2001 From: Piotr Machowski Date: Mon, 5 Jun 2023 00:32:12 +0200 Subject: [PATCH 4/4] Set version to v2.2.1 --- package.json | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/package.json b/package.json index 41147f8d..1ff54edd 100644 --- a/package.json +++ b/package.json @@ -1,6 +1,6 @@ { "name": "xiaomi-vacuum-map-card", - "version": "v2.2.0", + "version": "v2.2.1", "description": "Xiaomi Vacuum Map Card", "keywords": [ "home-assistant",