Move imports in knx component (#28008)
* Move imports in knx component * Fix pylint
This commit is contained in:
parent
6c18bbcf04
commit
ff17bb4a56
9 changed files with 29 additions and 55 deletions
|
@ -2,6 +2,7 @@
|
|||
from enum import Enum
|
||||
|
||||
import voluptuous as vol
|
||||
from xknx.devices import Light as XknxLight
|
||||
|
||||
from homeassistant.components.light import (
|
||||
ATTR_BRIGHTNESS,
|
||||
|
@ -98,8 +99,6 @@ def async_add_entities_discovery(hass, discovery_info, async_add_entities):
|
|||
@callback
|
||||
def async_add_entities_config(hass, config, async_add_entities):
|
||||
"""Set up light for KNX platform configured within platform."""
|
||||
import xknx
|
||||
|
||||
group_address_tunable_white = None
|
||||
group_address_tunable_white_state = None
|
||||
group_address_color_temp = None
|
||||
|
@ -111,7 +110,7 @@ def async_add_entities_config(hass, config, async_add_entities):
|
|||
group_address_tunable_white = config.get(CONF_COLOR_TEMP_ADDRESS)
|
||||
group_address_tunable_white_state = config.get(CONF_COLOR_TEMP_STATE_ADDRESS)
|
||||
|
||||
light = xknx.devices.Light(
|
||||
light = XknxLight(
|
||||
hass.data[DATA_KNX].xknx,
|
||||
name=config[CONF_NAME],
|
||||
group_address_switch=config[CONF_ADDRESS],
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue