From 95bc97fb6a8fd9ef424366a9688191894bbe74aa Mon Sep 17 00:00:00 2001 From: springstan <46536646+springstan@users.noreply.github.com> Date: Wed, 4 Dec 2019 14:11:14 +0100 Subject: [PATCH] Move imports to top for homeworks (#29418) --- homeassistant/components/homeworks/__init__.py | 3 +-- homeassistant/components/homeworks/light.py | 3 ++- 2 files changed, 3 insertions(+), 3 deletions(-) diff --git a/homeassistant/components/homeworks/__init__.py b/homeassistant/components/homeworks/__init__.py index bd40336b8ba..55357acdad4 100644 --- a/homeassistant/components/homeworks/__init__.py +++ b/homeassistant/components/homeworks/__init__.py @@ -1,6 +1,7 @@ """Support for Lutron Homeworks Series 4 and 8 systems.""" import logging +from pyhomeworks.pyhomeworks import HW_BUTTON_PRESSED, HW_BUTTON_RELEASED, Homeworks import voluptuous as vol from homeassistant.const import ( @@ -65,7 +66,6 @@ CONFIG_SCHEMA = vol.Schema( def setup(hass, base_config): """Start Homeworks controller.""" - from pyhomeworks.pyhomeworks import Homeworks def hw_callback(msg_type, values): """Dispatch state changes.""" @@ -138,7 +138,6 @@ class HomeworksKeypadEvent: @callback def _update_callback(self, msg_type, values): """Fire events if button is pressed or released.""" - from pyhomeworks.pyhomeworks import HW_BUTTON_PRESSED, HW_BUTTON_RELEASED if msg_type == HW_BUTTON_PRESSED: event = EVENT_BUTTON_PRESS diff --git a/homeassistant/components/homeworks/light.py b/homeassistant/components/homeworks/light.py index d1854b4dbf3..2c0034ee986 100644 --- a/homeassistant/components/homeworks/light.py +++ b/homeassistant/components/homeworks/light.py @@ -1,6 +1,8 @@ """Support for Lutron Homeworks lights.""" import logging +from pyhomeworks.pyhomeworks import HW_LIGHT_CHANGED + from homeassistant.components.light import ATTR_BRIGHTNESS, SUPPORT_BRIGHTNESS, Light from homeassistant.const import CONF_NAME from homeassistant.core import callback @@ -93,7 +95,6 @@ class HomeworksLight(HomeworksDevice, Light): @callback def _update_callback(self, msg_type, values): """Process device specific messages.""" - from pyhomeworks.pyhomeworks import HW_LIGHT_CHANGED if msg_type == HW_LIGHT_CHANGED: self._level = int((values[1] * 255.0) / 100.0)