From fb8be07d6fb11e63fc18173dab65c3b698911933 Mon Sep 17 00:00:00 2001 From: Kevin Eifinger Date: Mon, 22 Jul 2019 13:02:54 +0200 Subject: [PATCH] revert to top level import and add warning --- README.md | 6 ++++++ custom_components/here_travel_time/sensor.py | 4 +--- info.md | 12 ++++++++++++ 3 files changed, 19 insertions(+), 3 deletions(-) diff --git a/README.md b/README.md index 2c84bb6..28abb98 100644 --- a/README.md +++ b/README.md @@ -22,6 +22,12 @@ Platform | Description ## Installation +### Important information for hass.io users on > 0.96.0 + +If you are using hass.io in a version later than 0.96.0 you have to restart twice in order for this component to work. + +This is a known problem for some custom_components and will hopefully be fixed soon + ### HACS The easiest way to add this to your Homeassistant installation is using [HACS](https://custom-components.github.io/hacs/) and add this repository as a custom repository. diff --git a/custom_components/here_travel_time/sensor.py b/custom_components/here_travel_time/sensor.py index 1deb405..6bafb81 100644 --- a/custom_components/here_travel_time/sensor.py +++ b/custom_components/here_travel_time/sensor.py @@ -3,6 +3,7 @@ import logging import re +import herepy import voluptuous as vol from homeassistant.components.sensor import PLATFORM_SCHEMA @@ -272,7 +273,6 @@ 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,7 +290,6 @@ 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: @@ -384,7 +383,6 @@ def _get_route_from_public_transport_line(public_transport_line_segment): """Extract Waze-like route info from the public transport lines.""" lines = [] for line_info in public_transport_line_segment: - print(line_info) lines.append( line_info['lineName'] + " - " + line_info['destination']) diff --git a/info.md b/info.md index e080228..f84d19e 100644 --- a/info.md +++ b/info.md @@ -1,3 +1,15 @@ +{% if prerelease %} +# This is a Beta version! +{% endif %} + +# Important information for hass.io users on > 0.96.0 + +If you are using hass.io in a version later than 0.96.0 you have to restart twice in order for this component to work. + +This is a known problem for some custom_components and will hopefully be fixed soon + +--- + [![GitHub Release][releases-shield]][releases] [![GitHub Activity][commits-shield]][commits] [![hacs_badge](https://img.shields.io/badge/HACS-Custom-orange.svg?style=for-the-badge)](https://github.com/custom-components/hacs)