diff --git a/custom_components/here_travel_time/sensor.py b/custom_components/here_travel_time/sensor.py index d75e050..1deb405 100644 --- a/custom_components/here_travel_time/sensor.py +++ b/custom_components/here_travel_time/sensor.py @@ -3,7 +3,6 @@ import logging import re -import herepy import voluptuous as vol from homeassistant.components.sensor import PLATFORM_SCHEMA @@ -273,6 +272,7 @@ class HERETravelTimeData(): def __init__(self, origin, destination, app_id, app_code, travel_mode, traffic_mode, route_mode, units): """Initialize herepy.""" + import herepy self.origin = origin self.destination = destination self.travel_mode = travel_mode @@ -290,6 +290,7 @@ def __init__(self, origin, destination, app_id, app_code, travel_mode, def update(self): """Get the latest data from HERE.""" + import herepy if self.traffic_mode: traffic_mode = TRAFFIC_MODE_ENABLED else: