From 1a51590711548fa1c935b80d9a7b30a6210d8f08 Mon Sep 17 00:00:00 2001 From: springstan <46536646+springstan@users.noreply.github.com> Date: Wed, 4 Dec 2019 11:13:46 +0100 Subject: [PATCH] Move imports to top for lutron (#29389) --- homeassistant/components/lutron/__init__.py | 5 ++--- homeassistant/components/lutron/binary_sensor.py | 2 +- 2 files changed, 3 insertions(+), 4 deletions(-) diff --git a/homeassistant/components/lutron/__init__.py b/homeassistant/components/lutron/__init__.py index ac9a4eab417..ac6ffa46b27 100644 --- a/homeassistant/components/lutron/__init__.py +++ b/homeassistant/components/lutron/__init__.py @@ -1,11 +1,12 @@ """Component for interacting with a Lutron RadioRA 2 system.""" import logging +from pylutron import Button, Lutron 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.helpers import discovery +import homeassistant.helpers.config_validation as cv from homeassistant.helpers.entity import Entity from homeassistant.util import slugify @@ -36,7 +37,6 @@ CONFIG_SCHEMA = vol.Schema( def setup(hass, base_config): """Set up the Lutron component.""" - from pylutron import Lutron hass.data[LUTRON_BUTTONS] = [] hass.data[LUTRON_CONTROLLER] = None @@ -147,7 +147,6 @@ class LutronButton: def button_callback(self, button, context, event, params): """Fire an event about a button being pressed or released.""" - from pylutron import Button # Events per button type: # RaiseLower -> pressed/released diff --git a/homeassistant/components/lutron/binary_sensor.py b/homeassistant/components/lutron/binary_sensor.py index a86d56c325f..866c82a7b2a 100644 --- a/homeassistant/components/lutron/binary_sensor.py +++ b/homeassistant/components/lutron/binary_sensor.py @@ -2,8 +2,8 @@ from pylutron import OccupancyGroup from homeassistant.components.binary_sensor import ( - BinarySensorDevice, DEVICE_CLASS_OCCUPANCY, + BinarySensorDevice, ) from . import LUTRON_CONTROLLER, LUTRON_DEVICES, LutronDevice