Move constant to 'const.py' and use already definied ones (#10204)
This commit is contained in:
1 parent
97bb252d23
commit
115c59d88c
9 files changed
+43
-46
No files matched your search
@@ -14,7 +14,7 @@ from homeassistant.components.sensor import PLATFORM_SCHEMA
|
||||
from homeassistant.helpers.entity import Entity
|
||||
from homeassistant.const import (
|
||||
CONF_API_KEY, CONF_NAME, EVENT_HOMEASSISTANT_START, ATTR_LATITUDE,
|
||||
ATTR_LONGITUDE)
|
||||
ATTR_LONGITUDE, CONF_MODE)
|
||||
from homeassistant.util import Throttle
|
||||
import homeassistant.helpers.config_validation as cv
|
||||
import homeassistant.helpers.location as location
|
||||
@@ -25,7 +25,6 @@ REQUIREMENTS = ['googlemaps==2.5.1']
|
||||
_LOGGER = logging.getLogger(__name__)
|
||||
|
||||
CONF_DESTINATION = 'destination'
|
||||
CONF_MODE = 'mode'
|
||||
CONF_OPTIONS = 'options'
|
||||
CONF_ORIGIN = 'origin'
|
||||
CONF_TRAVEL_MODE = 'travel_mode'
|
||||
|
||||
@@ -6,13 +6,15 @@ https://home-assistant.io/components/sensor.uk_transport/
|
||||
import logging
|
||||
import re
|
||||
from datetime import datetime, timedelta
|
||||
|
||||
import requests
|
||||
import voluptuous as vol
|
||||
|
||||
import homeassistant.helpers.config_validation as cv
|
||||
from homeassistant.components.sensor import PLATFORM_SCHEMA
|
||||
from homeassistant.const import CONF_MODE
|
||||
from homeassistant.helpers.entity import Entity
|
||||
from homeassistant.util import Throttle
|
||||
import homeassistant.helpers.config_validation as cv
|
||||
|
||||
_LOGGER = logging.getLogger(__name__)
|
||||
|
||||
@@ -28,7 +30,6 @@ ATTR_NEXT_TRAINS = 'next_trains'
|
||||
CONF_API_APP_KEY = 'app_key'
|
||||
CONF_API_APP_ID = 'app_id'
|
||||
CONF_QUERIES = 'queries'
|
||||
CONF_MODE = 'mode'
|
||||
CONF_ORIGIN = 'origin'
|
||||
CONF_DESTINATION = 'destination'
|
||||
|
||||
|
||||
Reference in new issue
Block a user