mirror of
https://github.com/home-assistant/core.git
synced 2025-07-16 01:37:08 +00:00
moved imports to top level (#27495)
This commit is contained in:
parent
2c8e24eb14
commit
8436acbffa
@ -6,6 +6,8 @@ import logging
|
|||||||
import os
|
import os
|
||||||
|
|
||||||
from aiohttp import web
|
from aiohttp import web
|
||||||
|
import aioautomatic
|
||||||
|
|
||||||
import voluptuous as vol
|
import voluptuous as vol
|
||||||
|
|
||||||
from homeassistant.components.device_tracker import (
|
from homeassistant.components.device_tracker import (
|
||||||
@ -82,7 +84,6 @@ def _write_refresh_token_to_file(hass, filename, refresh_token):
|
|||||||
@asyncio.coroutine
|
@asyncio.coroutine
|
||||||
def async_setup_scanner(hass, config, async_see, discovery_info=None):
|
def async_setup_scanner(hass, config, async_see, discovery_info=None):
|
||||||
"""Validate the configuration and return an Automatic scanner."""
|
"""Validate the configuration and return an Automatic scanner."""
|
||||||
import aioautomatic
|
|
||||||
|
|
||||||
hass.http.register_view(AutomaticAuthCallbackView())
|
hass.http.register_view(AutomaticAuthCallbackView())
|
||||||
|
|
||||||
@ -215,7 +216,6 @@ class AutomaticData:
|
|||||||
@asyncio.coroutine
|
@asyncio.coroutine
|
||||||
def handle_event(self, name, event):
|
def handle_event(self, name, event):
|
||||||
"""Coroutine to update state for a real time event."""
|
"""Coroutine to update state for a real time event."""
|
||||||
import aioautomatic
|
|
||||||
|
|
||||||
self.hass.bus.async_fire(EVENT_AUTOMATIC_UPDATE, event.data)
|
self.hass.bus.async_fire(EVENT_AUTOMATIC_UPDATE, event.data)
|
||||||
|
|
||||||
@ -261,7 +261,6 @@ class AutomaticData:
|
|||||||
@asyncio.coroutine
|
@asyncio.coroutine
|
||||||
def ws_connect(self, now=None):
|
def ws_connect(self, now=None):
|
||||||
"""Open the websocket connection."""
|
"""Open the websocket connection."""
|
||||||
import aioautomatic
|
|
||||||
|
|
||||||
self.ws_close_requested = False
|
self.ws_close_requested = False
|
||||||
|
|
||||||
@ -321,7 +320,6 @@ class AutomaticData:
|
|||||||
@asyncio.coroutine
|
@asyncio.coroutine
|
||||||
def get_vehicle_info(self, vehicle):
|
def get_vehicle_info(self, vehicle):
|
||||||
"""Fetch the latest vehicle info from automatic."""
|
"""Fetch the latest vehicle info from automatic."""
|
||||||
import aioautomatic
|
|
||||||
|
|
||||||
name = vehicle.display_name
|
name = vehicle.display_name
|
||||||
if name is None:
|
if name is None:
|
||||||
|
Loading…
x
Reference in New Issue
Block a user