Move imports in rmvtransport (#27420)
This commit is contained in:
parent
f236e84753
commit
99e7808441
1 changed files with 2 additions and 4 deletions
|
@ -3,6 +3,8 @@ import asyncio
|
||||||
import logging
|
import logging
|
||||||
from datetime import timedelta
|
from datetime import timedelta
|
||||||
|
|
||||||
|
from RMVtransport import RMVtransport
|
||||||
|
from RMVtransport.rmvtransport import RMVtransportApiConnectionError
|
||||||
import voluptuous as vol
|
import voluptuous as vol
|
||||||
|
|
||||||
from homeassistant.components.sensor import PLATFORM_SCHEMA
|
from homeassistant.components.sensor import PLATFORM_SCHEMA
|
||||||
|
@ -208,8 +210,6 @@ class RMVDepartureData:
|
||||||
timeout,
|
timeout,
|
||||||
):
|
):
|
||||||
"""Initialize the sensor."""
|
"""Initialize the sensor."""
|
||||||
from RMVtransport import RMVtransport
|
|
||||||
|
|
||||||
self.station = None
|
self.station = None
|
||||||
self._station_id = station_id
|
self._station_id = station_id
|
||||||
self._destinations = destinations
|
self._destinations = destinations
|
||||||
|
@ -224,8 +224,6 @@ class RMVDepartureData:
|
||||||
@Throttle(SCAN_INTERVAL)
|
@Throttle(SCAN_INTERVAL)
|
||||||
async def async_update(self):
|
async def async_update(self):
|
||||||
"""Update the connection data."""
|
"""Update the connection data."""
|
||||||
from RMVtransport.rmvtransport import RMVtransportApiConnectionError
|
|
||||||
|
|
||||||
try:
|
try:
|
||||||
_data = await self.rmv.get_departures(
|
_data = await self.rmv.get_departures(
|
||||||
self._station_id,
|
self._station_id,
|
||||||
|
|
Loading…
Add table
Add a link
Reference in a new issue