load cleanups (#23112)
* load cleanups * Remove unused methods * Allow importing requirements at the top of a file * Fix test * Lint * Install reqs ASAP when loading platforms
This commit is contained in:
1 parent
4d080f8b17
commit
6a2da9f9a5
8 files changed
+64
-146
No files matched your search
@@ -1,6 +1,7 @@
|
||||
"""Code to handle a Hue bridge."""
|
||||
import asyncio
|
||||
|
||||
import aiohue
|
||||
import async_timeout
|
||||
import voluptuous as vol
|
||||
|
||||
@@ -133,8 +134,6 @@ class HueBridge:
|
||||
|
||||
async def get_bridge(hass, host, username=None):
|
||||
"""Create a bridge object and verify authentication."""
|
||||
import aiohue
|
||||
|
||||
bridge = aiohue.Bridge(
|
||||
host, username=username,
|
||||
websession=aiohttp_client.async_get_clientsession(hass)
|
||||
|
||||
@@ -3,6 +3,7 @@ import asyncio
|
||||
import json
|
||||
import os
|
||||
|
||||
from aiohue.discovery import discover_nupnp
|
||||
import async_timeout
|
||||
import voluptuous as vol
|
||||
|
||||
@@ -57,8 +58,6 @@ class HueFlowHandler(config_entries.ConfigFlow):
|
||||
|
||||
async def async_step_init(self, user_input=None):
|
||||
"""Handle a flow start."""
|
||||
from aiohue.discovery import discover_nupnp
|
||||
|
||||
if user_input is not None:
|
||||
self.host = user_input['host']
|
||||
return await self.async_step_link()
|
||||
|
||||
@@ -5,6 +5,7 @@ import logging
|
||||
from time import monotonic
|
||||
import random
|
||||
|
||||
import aiohue
|
||||
import async_timeout
|
||||
|
||||
from homeassistant.components import hue
|
||||
@@ -152,8 +153,6 @@ async def async_update_items(hass, bridge, async_add_entities,
|
||||
request_bridge_update, is_group, current,
|
||||
progress_waiting):
|
||||
"""Update either groups or lights from the bridge."""
|
||||
import aiohue
|
||||
|
||||
if is_group:
|
||||
api_type = 'group'
|
||||
api = bridge.api.groups
|
||||
|
||||
Reference in new issue
Block a user