From 76ff77b6d0c8efd9a8e316e865f89361afbba2e3 Mon Sep 17 00:00:00 2001 From: Hugo Bloem Date: Fri, 18 Oct 2024 15:38:46 +0000 Subject: [PATCH] fix: areas incorrectly resolved --- custom_components/stateful_scenes/StatefulScenes.py | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/custom_components/stateful_scenes/StatefulScenes.py b/custom_components/stateful_scenes/StatefulScenes.py index 01fda02..6b537fc 100644 --- a/custom_components/stateful_scenes/StatefulScenes.py +++ b/custom_components/stateful_scenes/StatefulScenes.py @@ -6,7 +6,7 @@ import yaml import os from homeassistant.core import HomeAssistant, Event, EventStateChangedData -from homeassistant.helpers.template import area_id +from homeassistant.helpers.template import area_id, area_name from .helpers import ( get_name_from_entity_id, get_icon_from_entity_id, @@ -178,7 +178,7 @@ def extract_scene_configuration(self, scene_conf: dict) -> dict: "icon", get_icon_from_entity_id(self.hass, entity_id) ), "entity_id": entity_id, - "area": area_id(self.hass, entity_id), + "area": area_name(self.hass, area_id(self.hass, entity_id)), "learn": scene_conf.get("learn", False), "entities": entities, "number_tolerance": scene_conf.get( @@ -193,7 +193,7 @@ def prepare_external_scene(self, entity_id, entities) -> dict: "id": get_id_from_entity_id(self.hass, entity_id), "icon": get_icon_from_entity_id(self.hass, entity_id), "entity_id": entity_id, - "area": area_id(self.hass, entity_id), + "area": area_name(self.hass, area_id(self.hass, entity_id)), "learn": True, "entities": entities, }