Move imports to top for lutron (#29389)

pull/29390/merge
springstan 2019-12-04 11:13:46 +01:00 committed by Fabian Affolter
parent 49232332a1
commit 1a51590711
2 changed files with 3 additions and 4 deletions

View File

@ -1,11 +1,12 @@
"""Component for interacting with a Lutron RadioRA 2 system.""" """Component for interacting with a Lutron RadioRA 2 system."""
import logging import logging
from pylutron import Button, Lutron
import voluptuous as vol import voluptuous as vol
import homeassistant.helpers.config_validation as cv
from homeassistant.const import ATTR_ID, CONF_HOST, CONF_PASSWORD, CONF_USERNAME from homeassistant.const import ATTR_ID, CONF_HOST, CONF_PASSWORD, CONF_USERNAME
from homeassistant.helpers import discovery from homeassistant.helpers import discovery
import homeassistant.helpers.config_validation as cv
from homeassistant.helpers.entity import Entity from homeassistant.helpers.entity import Entity
from homeassistant.util import slugify from homeassistant.util import slugify
@ -36,7 +37,6 @@ CONFIG_SCHEMA = vol.Schema(
def setup(hass, base_config): def setup(hass, base_config):
"""Set up the Lutron component.""" """Set up the Lutron component."""
from pylutron import Lutron
hass.data[LUTRON_BUTTONS] = [] hass.data[LUTRON_BUTTONS] = []
hass.data[LUTRON_CONTROLLER] = None hass.data[LUTRON_CONTROLLER] = None
@ -147,7 +147,6 @@ class LutronButton:
def button_callback(self, button, context, event, params): def button_callback(self, button, context, event, params):
"""Fire an event about a button being pressed or released.""" """Fire an event about a button being pressed or released."""
from pylutron import Button
# Events per button type: # Events per button type:
# RaiseLower -> pressed/released # RaiseLower -> pressed/released

View File

@ -2,8 +2,8 @@
from pylutron import OccupancyGroup from pylutron import OccupancyGroup
from homeassistant.components.binary_sensor import ( from homeassistant.components.binary_sensor import (
BinarySensorDevice,
DEVICE_CLASS_OCCUPANCY, DEVICE_CLASS_OCCUPANCY,
BinarySensorDevice,
) )
from . import LUTRON_CONTROLLER, LUTRON_DEVICES, LutronDevice from . import LUTRON_CONTROLLER, LUTRON_DEVICES, LutronDevice