From 978d706b089d38443099337d37c3fc33fa8eb9e0 Mon Sep 17 00:00:00 2001 From: tkdrob Date: Tue, 27 Apr 2021 10:05:03 -0400 Subject: [PATCH] Clean up deconz constants (#49754) --- homeassistant/components/deconz/const.py | 4 +--- homeassistant/components/deconz/deconz_event.py | 3 ++- homeassistant/components/deconz/lock.py | 12 +++++++++--- 3 files changed, 12 insertions(+), 7 deletions(-) diff --git a/homeassistant/components/deconz/const.py b/homeassistant/components/deconz/const.py index fb4e497587d6..799fc221e2c5 100644 --- a/homeassistant/components/deconz/const.py +++ b/homeassistant/components/deconz/const.py @@ -64,8 +64,7 @@ COVER_TYPES = DAMPERS + WINDOW_COVERS FANS = ["Fan"] # Locks -LOCKS = ["Door Lock", "ZHADoorLock"] -LOCK_TYPES = LOCKS +LOCK_TYPES = ["Door Lock", "ZHADoorLock"] # Switches POWER_PLUGS = ["On/Off light", "On/Off plug-in unit", "Smart plug"] @@ -74,4 +73,3 @@ SWITCH_TYPES = POWER_PLUGS + SIRENS CONF_ANGLE = "angle" CONF_GESTURE = "gesture" -CONF_XY = "xy" diff --git a/homeassistant/components/deconz/deconz_event.py b/homeassistant/components/deconz/deconz_event.py index 11dbfa89c908..afb9dd7fc79f 100644 --- a/homeassistant/components/deconz/deconz_event.py +++ b/homeassistant/components/deconz/deconz_event.py @@ -15,6 +15,7 @@ from homeassistant.const import ( CONF_EVENT, CONF_ID, CONF_UNIQUE_ID, + CONF_XY, STATE_ALARM_ARMED_AWAY, STATE_ALARM_ARMED_HOME, STATE_ALARM_ARMED_NIGHT, @@ -25,7 +26,7 @@ from homeassistant.core import callback from homeassistant.helpers.dispatcher import async_dispatcher_connect from homeassistant.util import slugify -from .const import CONF_ANGLE, CONF_GESTURE, CONF_XY, LOGGER, NEW_SENSOR +from .const import CONF_ANGLE, CONF_GESTURE, LOGGER, NEW_SENSOR from .deconz_device import DeconzBase CONF_DECONZ_EVENT = "deconz_event" diff --git a/homeassistant/components/deconz/lock.py b/homeassistant/components/deconz/lock.py index 6daa6cd15376..75f6bc872dbc 100644 --- a/homeassistant/components/deconz/lock.py +++ b/homeassistant/components/deconz/lock.py @@ -3,7 +3,7 @@ from homeassistant.components.lock import DOMAIN, LockEntity from homeassistant.core import callback from homeassistant.helpers.dispatcher import async_dispatcher_connect -from .const import LOCKS, NEW_LIGHT, NEW_SENSOR +from .const import LOCK_TYPES, NEW_LIGHT, NEW_SENSOR from .deconz_device import DeconzDevice from .gateway import get_gateway_from_config_entry @@ -20,7 +20,10 @@ async def async_setup_entry(hass, config_entry, async_add_entities): for light in lights: - if light.type in LOCKS and light.uniqueid not in gateway.entities[DOMAIN]: + if ( + light.type in LOCK_TYPES + and light.uniqueid not in gateway.entities[DOMAIN] + ): entities.append(DeconzLock(light, gateway)) if entities: @@ -39,7 +42,10 @@ async def async_setup_entry(hass, config_entry, async_add_entities): for sensor in sensors: - if sensor.type in LOCKS and sensor.uniqueid not in gateway.entities[DOMAIN]: + if ( + sensor.type in LOCK_TYPES + and sensor.uniqueid not in gateway.entities[DOMAIN] + ): entities.append(DeconzLock(sensor, gateway)) if entities: