From 1b681a8cbc5afd2ea1158da809cacc595b104920 Mon Sep 17 00:00:00 2001 From: Petter Date: Sun, 27 Nov 2022 21:53:42 +0100 Subject: [PATCH] Fix issue #66 Updates geo_location.py to be compliant with HA 23.1 --- custom_components/blitzortung/geo_location.py | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/custom_components/blitzortung/geo_location.py b/custom_components/blitzortung/geo_location.py index a9e1930..ee24873 100644 --- a/custom_components/blitzortung/geo_location.py +++ b/custom_components/blitzortung/geo_location.py @@ -7,7 +7,6 @@ from homeassistant.components.geo_location import GeolocationEvent from homeassistant.const import ( ATTR_ATTRIBUTION, - CONF_UNIT_SYSTEM_IMPERIAL, LENGTH_KILOMETERS, LENGTH_MILES, ) @@ -17,6 +16,7 @@ async_dispatcher_send, ) from homeassistant.util.dt import utc_from_timestamp +from homeassistant.util.unit_system import IMPERIAL_SYSTEM from .const import ATTR_EXTERNAL_ID, ATTR_PUBLICATION_DATE, ATTRIBUTION, DOMAIN @@ -97,7 +97,7 @@ def __init__( self._strikes = Strikes(max_tracked_lightnings) self._window_seconds = window_seconds - if hass.config.units.name == CONF_UNIT_SYSTEM_IMPERIAL: + if hass.config.units == IMPERIAL_SYSTEM: self._unit = LENGTH_MILES else: self._unit = LENGTH_KILOMETERS