Skip to content
Snippets Groups Projects
Commit 722af901 authored by Fabian Affolter's avatar Fabian Affolter
Browse files

Update import style

parent 6c1f4424
No related branches found
No related tags found
No related merge requests found
......@@ -31,7 +31,7 @@ Details for the API : http://transport.opendata.ch
"""
import logging
from datetime import timedelta
from requests import get
import requests
from homeassistant.util import Throttle
import homeassistant.util.dt as dt_util
......@@ -53,8 +53,8 @@ def setup_platform(hass, config, add_devices, discovery_info=None):
try:
for location in [config.get('from', None), config.get('to', None)]:
# transport.opendata.ch doesn't play nice with requests.Session
result = get(_RESOURCE + 'locations?query=%s' % location,
timeout=10)
result = requests.get(_RESOURCE + 'locations?query=%s' % location,
timeout=10)
journey.append(result.json()['stations'][0]['name'])
except KeyError:
_LOGGER.exception(
......@@ -110,7 +110,7 @@ class PublicTransportData(object):
def update(self):
""" Gets the latest data from opendata.ch. """
response = get(
response = requests.get(
_RESOURCE +
'connections?' +
'from=' + self.start + '&' +
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Please register or to comment