From fcccfb9f2553c7e92ecf15dd19cfce0c7a54497f Mon Sep 17 00:00:00 2001 From: epenet <6771947+epenet@users.noreply.github.com> Date: Fri, 3 Jul 2026 12:54:36 +0200 Subject: [PATCH] Use Attribute enum in geo_location (#175357) --- homeassistant/components/geo_location/trigger.py | 6 +++++- 1 file changed, 5 insertions(+), 1 deletion(-) diff --git a/homeassistant/components/geo_location/trigger.py b/homeassistant/components/geo_location/trigger.py index 6ab87f3da8ef..500ce5745c24 100644 --- a/homeassistant/components/geo_location/trigger.py +++ b/homeassistant/components/geo_location/trigger.py @@ -23,6 +23,7 @@ from homeassistant.helpers.trigger import TriggerActionType, TriggerInfo from homeassistant.helpers.typing import ConfigType from . import DOMAIN +from .const import GeolocationEntityStateAttribute _LOGGER = logging.getLogger(__name__) @@ -44,7 +45,10 @@ TRIGGER_SCHEMA = cv.TRIGGER_BASE_SCHEMA.extend( def source_match(state: State | None, source: str) -> bool: """Check if the state matches the provided source.""" - return state is not None and state.attributes.get("source") == source + return ( + state is not None + and state.attributes.get(GeolocationEntityStateAttribute.SOURCE) == source + ) async def async_attach_trigger(