Move imports in everlights component (#27983)
This commit is contained in:
parent
bf6a30d1bb
commit
ef8f88e25a
1 changed files with 10 additions and 13 deletions
|
@ -1,25 +1,26 @@
|
|||
"""Support for EverLights lights."""
|
||||
import logging
|
||||
from datetime import timedelta
|
||||
import logging
|
||||
from typing import Tuple
|
||||
|
||||
import pyeverlights
|
||||
import voluptuous as vol
|
||||
|
||||
from homeassistant.const import CONF_HOSTS
|
||||
from homeassistant.components.light import (
|
||||
ATTR_BRIGHTNESS,
|
||||
ATTR_HS_COLOR,
|
||||
ATTR_EFFECT,
|
||||
SUPPORT_BRIGHTNESS,
|
||||
SUPPORT_EFFECT,
|
||||
SUPPORT_COLOR,
|
||||
Light,
|
||||
ATTR_HS_COLOR,
|
||||
PLATFORM_SCHEMA,
|
||||
SUPPORT_BRIGHTNESS,
|
||||
SUPPORT_COLOR,
|
||||
SUPPORT_EFFECT,
|
||||
Light,
|
||||
)
|
||||
from homeassistant.const import CONF_HOSTS
|
||||
from homeassistant.exceptions import PlatformNotReady
|
||||
from homeassistant.helpers.aiohttp_client import async_get_clientsession
|
||||
import homeassistant.helpers.config_validation as cv
|
||||
import homeassistant.util.color as color_util
|
||||
from homeassistant.helpers.aiohttp_client import async_get_clientsession
|
||||
from homeassistant.exceptions import PlatformNotReady
|
||||
|
||||
_LOGGER = logging.getLogger(__name__)
|
||||
|
||||
|
@ -46,8 +47,6 @@ def color_int_to_rgb(value: int) -> Tuple[int, int, int]:
|
|||
|
||||
async def async_setup_platform(hass, config, async_add_entities, discovery_info=None):
|
||||
"""Set up the EverLights lights from configuration.yaml."""
|
||||
import pyeverlights
|
||||
|
||||
lights = []
|
||||
|
||||
for ipaddr in config[CONF_HOSTS]:
|
||||
|
@ -159,8 +158,6 @@ class EverLightsLight(Light):
|
|||
|
||||
async def async_update(self):
|
||||
"""Synchronize state with control box."""
|
||||
import pyeverlights
|
||||
|
||||
try:
|
||||
self._status = await self._api.get_status()
|
||||
except pyeverlights.ConnectionError:
|
||||
|
|
Loading…
Add table
Reference in a new issue