mirror of
https://github.com/home-assistant/core
synced 2024-09-03 08:14:07 +02:00
Move imports in lifx component (#28012)
This commit is contained in:
parent
6742b36a3d
commit
9a9cd1d0b2
@ -1,12 +1,12 @@
|
||||
"""Support for LIFX."""
|
||||
import voluptuous as vol
|
||||
import homeassistant.helpers.config_validation as cv
|
||||
|
||||
from homeassistant import config_entries
|
||||
from homeassistant.const import CONF_PORT
|
||||
from homeassistant.components.light import DOMAIN as LIGHT_DOMAIN
|
||||
from .const import DOMAIN
|
||||
from homeassistant.const import CONF_PORT
|
||||
import homeassistant.helpers.config_validation as cv
|
||||
|
||||
from .const import DOMAIN
|
||||
|
||||
CONF_SERVER = "server"
|
||||
CONF_BROADCAST = "broadcast"
|
||||
|
@ -1,13 +1,14 @@
|
||||
"""Config flow flow LIFX."""
|
||||
from homeassistant.helpers import config_entry_flow
|
||||
import aiolifx
|
||||
|
||||
from homeassistant import config_entries
|
||||
from homeassistant.helpers import config_entry_flow
|
||||
|
||||
from .const import DOMAIN
|
||||
|
||||
|
||||
async def _async_has_devices(hass):
|
||||
"""Return if there are devices that can be discovered."""
|
||||
import aiolifx
|
||||
|
||||
lifx_ip_addresses = await aiolifx.LifxScan(hass.loop).scan()
|
||||
return len(lifx_ip_addresses) > 0
|
||||
|
||||
|
@ -6,6 +6,8 @@ import logging
|
||||
import math
|
||||
import sys
|
||||
|
||||
import aiolifx as aiolifx_module
|
||||
import aiolifx_effects as aiolifx_effects_module
|
||||
import voluptuous as vol
|
||||
|
||||
from homeassistant import util
|
||||
@ -151,15 +153,11 @@ LIFX_EFFECT_STOP_SCHEMA = vol.Schema({vol.Optional(ATTR_ENTITY_ID): cv.entity_id
|
||||
|
||||
def aiolifx():
|
||||
"""Return the aiolifx module."""
|
||||
import aiolifx as aiolifx_module
|
||||
|
||||
return aiolifx_module
|
||||
|
||||
|
||||
def aiolifx_effects():
|
||||
"""Return the aiolifx_effects module."""
|
||||
import aiolifx_effects as aiolifx_effects_module
|
||||
|
||||
return aiolifx_effects_module
|
||||
|
||||
|
||||
|
Loading…
Reference in New Issue
Block a user