From 43e36da5c6140b43a116931e5b44fc7dd4f023c7 Mon Sep 17 00:00:00 2001 From: Rod Payne Date: Wed, 17 Apr 2024 19:49:36 -0600 Subject: [PATCH] SOURCE_TYPE_GPS deprecated, Issue #15 --- custom_components/person_location/process_trigger.py | 5 ++--- 1 file changed, 2 insertions(+), 3 deletions(-) diff --git a/custom_components/person_location/process_trigger.py b/custom_components/person_location/process_trigger.py index 6942c2d..e9a5707 100644 --- a/custom_components/person_location/process_trigger.py +++ b/custom_components/person_location/process_trigger.py @@ -5,9 +5,9 @@ from datetime import datetime, timedelta, timezone from functools import partial +from homeassistant.components.device_tracker import SourceType from homeassistant.components.device_tracker.const import ( ATTR_SOURCE_TYPE, - SOURCE_TYPE_GPS, ) from homeassistant.components.mobile_app.const import ( ATTR_VERTICAL_ACCURACY, @@ -23,7 +23,6 @@ STATE_UNAVAILABLE, STATE_UNKNOWN, ) -from homeassistant.exceptions import ServiceNotFound from homeassistant.helpers.event import ( track_point_in_time, ) @@ -304,7 +303,7 @@ def handle_process_trigger(call): trigger.entity_id, target.entity_id, ) - elif triggerSourceType == SOURCE_TYPE_GPS: # gps device? + elif triggerSourceType == SourceType.GPS: # gps device? if triggerTo != triggerFrom: # did it change zones? saveThisUpdate = True # gps changing zones is assumed to be new, correct info _LOGGER.debug(