mirror of
https://github.com/home-assistant/core.git
synced 2025-07-20 11:47:06 +00:00
Move imports to top for doorbird (#33627)
This commit is contained in:
parent
b112be3556
commit
f71125092f
@ -4,6 +4,7 @@ import logging
|
|||||||
import urllib
|
import urllib
|
||||||
from urllib.error import HTTPError
|
from urllib.error import HTTPError
|
||||||
|
|
||||||
|
from aiohttp import web
|
||||||
from doorbirdpy import DoorBird
|
from doorbirdpy import DoorBird
|
||||||
import voluptuous as vol
|
import voluptuous as vol
|
||||||
|
|
||||||
@ -58,7 +59,6 @@ CONFIG_SCHEMA = vol.Schema(
|
|||||||
|
|
||||||
async def async_setup(hass: HomeAssistant, config: dict):
|
async def async_setup(hass: HomeAssistant, config: dict):
|
||||||
"""Set up the DoorBird component."""
|
"""Set up the DoorBird component."""
|
||||||
|
|
||||||
hass.data.setdefault(DOMAIN, {})
|
hass.data.setdefault(DOMAIN, {})
|
||||||
|
|
||||||
# Provide an endpoint for the doorstations to call to trigger events
|
# Provide an endpoint for the doorstations to call to trigger events
|
||||||
@ -341,8 +341,6 @@ class DoorBirdRequestView(HomeAssistantView):
|
|||||||
|
|
||||||
async def get(self, request, event):
|
async def get(self, request, event):
|
||||||
"""Respond to requests from the device."""
|
"""Respond to requests from the device."""
|
||||||
from aiohttp import web
|
|
||||||
|
|
||||||
hass = request.app["hass"]
|
hass = request.app["hass"]
|
||||||
|
|
||||||
token = request.query.get("token")
|
token = request.query.get("token")
|
||||||
|
Loading…
x
Reference in New Issue
Block a user