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
|
@ -1,5 +1,6 @@
|
|||
"""Support for KNX/IP switches."""
|
||||
import voluptuous as vol
|
||||
from xknx.devices import Switch as XknxSwitch
|
||||
|
||||
from homeassistant.components.switch import PLATFORM_SCHEMA, SwitchDevice
|
||||
from homeassistant.const import CONF_ADDRESS, CONF_NAME
|
||||
|
@ -41,9 +42,7 @@ def async_add_entities_discovery(hass, discovery_info, async_add_entities):
|
|||
@callback
|
||||
def async_add_entities_config(hass, config, async_add_entities):
|
||||
"""Set up switch for KNX platform configured within platform."""
|
||||
import xknx
|
||||
|
||||
switch = xknx.devices.Switch(
|
||||
switch = XknxSwitch(
|
||||
hass.data[DATA_KNX].xknx,
|
||||
name=config[CONF_NAME],
|
||||
group_address=config[CONF_ADDRESS],
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue