mirror of
https://github.com/home-assistant/core.git
synced 2025-07-23 05:07:41 +00:00
Order imports (#23623)
This commit is contained in:
parent
5c413eb497
commit
a6b898d702
@ -1,5 +1,4 @@
|
|||||||
"""Support for the Opple light."""
|
"""Support for the Opple light."""
|
||||||
|
|
||||||
import logging
|
import logging
|
||||||
|
|
||||||
import voluptuous as vol
|
import voluptuous as vol
|
||||||
@ -9,10 +8,9 @@ from homeassistant.components.light import (
|
|||||||
SUPPORT_COLOR_TEMP, Light)
|
SUPPORT_COLOR_TEMP, Light)
|
||||||
from homeassistant.const import CONF_HOST, CONF_NAME
|
from homeassistant.const import CONF_HOST, CONF_NAME
|
||||||
import homeassistant.helpers.config_validation as cv
|
import homeassistant.helpers.config_validation as cv
|
||||||
from homeassistant.util.color import \
|
from homeassistant.util.color import (
|
||||||
color_temperature_kelvin_to_mired as kelvin_to_mired
|
color_temperature_kelvin_to_mired as kelvin_to_mired,
|
||||||
from homeassistant.util.color import \
|
color_temperature_mired_to_kelvin as mired_to_kelvin)
|
||||||
color_temperature_mired_to_kelvin as mired_to_kelvin
|
|
||||||
|
|
||||||
_LOGGER = logging.getLogger(__name__)
|
_LOGGER = logging.getLogger(__name__)
|
||||||
|
|
||||||
@ -20,15 +18,16 @@ DEFAULT_NAME = "opple light"
|
|||||||
|
|
||||||
PLATFORM_SCHEMA = PLATFORM_SCHEMA.extend({
|
PLATFORM_SCHEMA = PLATFORM_SCHEMA.extend({
|
||||||
vol.Required(CONF_HOST): cv.string,
|
vol.Required(CONF_HOST): cv.string,
|
||||||
vol.Optional(CONF_NAME, default=DEFAULT_NAME): cv.string
|
vol.Optional(CONF_NAME, default=DEFAULT_NAME): cv.string,
|
||||||
})
|
})
|
||||||
|
|
||||||
|
|
||||||
def setup_platform(hass, config, add_entities, discovery_info=None):
|
def setup_platform(hass, config, add_entities, discovery_info=None):
|
||||||
"""Set up Opple light platform."""
|
"""Set up the Opple light platform."""
|
||||||
name = config[CONF_NAME]
|
name = config[CONF_NAME]
|
||||||
host = config[CONF_HOST]
|
host = config[CONF_HOST]
|
||||||
entity = OppleLight(name, host)
|
entity = OppleLight(name, host)
|
||||||
|
|
||||||
add_entities([entity])
|
add_entities([entity])
|
||||||
|
|
||||||
_LOGGER.debug("Init light %s %s", host, entity.unique_id)
|
_LOGGER.debug("Init light %s %s", host, entity.unique_id)
|
||||||
|
Loading…
x
Reference in New Issue
Block a user