Move imports to top for websocket_api (#29556)

* Move imports to top for websocket_api

* Move back an import because of circular dependency, add annotations
This commit is contained in:
springstan 2019-12-08 12:19:15 +01:00 committed by Paulus Schoutsen
parent 21cf6777bb
commit 6de8072e8a
10 changed files with 23 additions and 28 deletions

View file

@ -2,16 +2,15 @@
import voluptuous as vol
from homeassistant.auth.permissions.const import POLICY_READ
from homeassistant.const import MATCH_ALL, EVENT_TIME_CHANGED, EVENT_STATE_CHANGED
from homeassistant.core import callback, DOMAIN as HASS_DOMAIN
from homeassistant.exceptions import Unauthorized, ServiceNotFound, HomeAssistantError
from homeassistant.const import EVENT_STATE_CHANGED, EVENT_TIME_CHANGED, MATCH_ALL
from homeassistant.core import DOMAIN as HASS_DOMAIN, callback
from homeassistant.exceptions import HomeAssistantError, ServiceNotFound, Unauthorized
from homeassistant.helpers import config_validation as cv
from homeassistant.helpers.service import async_get_all_descriptions
from homeassistant.helpers.event import async_track_state_change
from homeassistant.helpers.service import async_get_all_descriptions
from . import const, decorators, messages
# mypy: allow-untyped-calls, allow-untyped-defs
@ -45,6 +44,8 @@ def handle_subscribe_events(hass, connection, msg):
Async friendly.
"""
# Circular dep
# pylint: disable=import-outside-toplevel
from .permissions import SUBSCRIBE_WHITELIST
event_type = msg["event_type"]