From a3f0d5573772307bf57d3cadd4e1723614c435e5 Mon Sep 17 00:00:00 2001 From: Robert Svensson Date: Tue, 15 Jan 2019 19:29:56 +0100 Subject: [PATCH] Change deCONZ to embedded platforms (#20113) Move all platforms into components/deconz --- .../{binary_sensor/deconz.py => deconz/binary_sensor.py} | 7 ++++--- .../components/{cover/deconz.py => deconz/cover.py} | 7 ++++--- .../components/{light/deconz.py => deconz/light.py} | 7 ++++--- .../components/{scene/deconz.py => deconz/scene.py} | 0 .../components/{sensor/deconz.py => deconz/sensor.py} | 7 ++++--- .../components/{switch/deconz.py => deconz/switch.py} | 5 +++-- .../test_deconz.py => deconz/test_binary_sensor.py} | 0 .../{cover/test_deconz.py => deconz/test_cover.py} | 0 .../{light/test_deconz.py => deconz/test_light.py} | 0 .../{scene/test_deconz.py => deconz/test_scene.py} | 0 .../{sensor/test_deconz.py => deconz/test_sensor.py} | 0 .../{switch/test_deconz.py => deconz/test_switch.py} | 0 12 files changed, 19 insertions(+), 14 deletions(-) rename homeassistant/components/{binary_sensor/deconz.py => deconz/binary_sensor.py} (98%) rename homeassistant/components/{cover/deconz.py => deconz/cover.py} (99%) rename homeassistant/components/{light/deconz.py => deconz/light.py} (99%) rename homeassistant/components/{scene/deconz.py => deconz/scene.py} (100%) rename homeassistant/components/{sensor/deconz.py => deconz/sensor.py} (99%) rename homeassistant/components/{switch/deconz.py => deconz/switch.py} (98%) rename tests/components/{binary_sensor/test_deconz.py => deconz/test_binary_sensor.py} (100%) rename tests/components/{cover/test_deconz.py => deconz/test_cover.py} (100%) rename tests/components/{light/test_deconz.py => deconz/test_light.py} (100%) rename tests/components/{scene/test_deconz.py => deconz/test_scene.py} (100%) rename tests/components/{sensor/test_deconz.py => deconz/test_sensor.py} (100%) rename tests/components/{switch/test_deconz.py => deconz/test_switch.py} (100%) diff --git a/homeassistant/components/binary_sensor/deconz.py b/homeassistant/components/deconz/binary_sensor.py similarity index 98% rename from homeassistant/components/binary_sensor/deconz.py rename to homeassistant/components/deconz/binary_sensor.py index b9fdb08e068..c67a4673983 100644 --- a/homeassistant/components/binary_sensor/deconz.py +++ b/homeassistant/components/deconz/binary_sensor.py @@ -5,14 +5,15 @@ For more details about this component, please refer to the documentation at https://home-assistant.io/components/binary_sensor.deconz/ """ from homeassistant.components.binary_sensor import BinarySensorDevice -from homeassistant.components.deconz.const import ( - ATTR_DARK, ATTR_ON, CONF_ALLOW_CLIP_SENSOR, DECONZ_REACHABLE, - DOMAIN as DECONZ_DOMAIN) from homeassistant.const import ATTR_BATTERY_LEVEL from homeassistant.core import callback from homeassistant.helpers.device_registry import CONNECTION_ZIGBEE from homeassistant.helpers.dispatcher import async_dispatcher_connect +from .const import ( + ATTR_DARK, ATTR_ON, CONF_ALLOW_CLIP_SENSOR, DECONZ_REACHABLE, + DOMAIN as DECONZ_DOMAIN) + DEPENDENCIES = ['deconz'] diff --git a/homeassistant/components/cover/deconz.py b/homeassistant/components/deconz/cover.py similarity index 99% rename from homeassistant/components/cover/deconz.py rename to homeassistant/components/deconz/cover.py index be60997869c..ffd5c912a37 100644 --- a/homeassistant/components/cover/deconz.py +++ b/homeassistant/components/deconz/cover.py @@ -4,9 +4,6 @@ Support for deCONZ covers. For more details about this platform, please refer to the documentation at https://home-assistant.io/components/cover.deconz/ """ -from homeassistant.components.deconz.const import ( - COVER_TYPES, DAMPERS, DECONZ_REACHABLE, DOMAIN as DECONZ_DOMAIN, - WINDOW_COVERS) from homeassistant.components.cover import ( ATTR_POSITION, CoverDevice, SUPPORT_CLOSE, SUPPORT_OPEN, SUPPORT_STOP, SUPPORT_SET_POSITION) @@ -14,6 +11,10 @@ from homeassistant.core import callback from homeassistant.helpers.device_registry import CONNECTION_ZIGBEE from homeassistant.helpers.dispatcher import async_dispatcher_connect +from .const import ( + COVER_TYPES, DAMPERS, DECONZ_REACHABLE, DOMAIN as DECONZ_DOMAIN, + WINDOW_COVERS) + DEPENDENCIES = ['deconz'] ZIGBEE_SPEC = ['lumi.curtain'] diff --git a/homeassistant/components/light/deconz.py b/homeassistant/components/deconz/light.py similarity index 99% rename from homeassistant/components/light/deconz.py rename to homeassistant/components/deconz/light.py index ae2d241d81f..a7ad38dd8b7 100644 --- a/homeassistant/components/light/deconz.py +++ b/homeassistant/components/deconz/light.py @@ -4,9 +4,6 @@ Support for deCONZ light. For more details about this component, please refer to the documentation at https://home-assistant.io/components/light.deconz/ """ -from homeassistant.components.deconz.const import ( - CONF_ALLOW_DECONZ_GROUPS, DECONZ_REACHABLE, DOMAIN as DECONZ_DOMAIN, - COVER_TYPES, SWITCH_TYPES) from homeassistant.components.light import ( ATTR_BRIGHTNESS, ATTR_COLOR_TEMP, ATTR_EFFECT, ATTR_FLASH, ATTR_HS_COLOR, ATTR_TRANSITION, EFFECT_COLORLOOP, FLASH_LONG, FLASH_SHORT, @@ -17,6 +14,10 @@ from homeassistant.helpers.device_registry import CONNECTION_ZIGBEE from homeassistant.helpers.dispatcher import async_dispatcher_connect import homeassistant.util.color as color_util +from .const import ( + CONF_ALLOW_DECONZ_GROUPS, DECONZ_REACHABLE, DOMAIN as DECONZ_DOMAIN, + COVER_TYPES, SWITCH_TYPES) + DEPENDENCIES = ['deconz'] diff --git a/homeassistant/components/scene/deconz.py b/homeassistant/components/deconz/scene.py similarity index 100% rename from homeassistant/components/scene/deconz.py rename to homeassistant/components/deconz/scene.py diff --git a/homeassistant/components/sensor/deconz.py b/homeassistant/components/deconz/sensor.py similarity index 99% rename from homeassistant/components/sensor/deconz.py rename to homeassistant/components/deconz/sensor.py index e2c9b59c59c..da5dcc84935 100644 --- a/homeassistant/components/sensor/deconz.py +++ b/homeassistant/components/deconz/sensor.py @@ -4,9 +4,6 @@ Support for deCONZ sensor. For more details about this component, please refer to the documentation at https://home-assistant.io/components/sensor.deconz/ """ -from homeassistant.components.deconz.const import ( - ATTR_DARK, ATTR_ON, CONF_ALLOW_CLIP_SENSOR, DECONZ_REACHABLE, - DOMAIN as DECONZ_DOMAIN) from homeassistant.const import ( ATTR_BATTERY_LEVEL, ATTR_VOLTAGE, DEVICE_CLASS_BATTERY) from homeassistant.core import callback @@ -15,6 +12,10 @@ from homeassistant.helpers.dispatcher import async_dispatcher_connect from homeassistant.helpers.entity import Entity from homeassistant.util import slugify +from .const import ( + ATTR_DARK, ATTR_ON, CONF_ALLOW_CLIP_SENSOR, DECONZ_REACHABLE, + DOMAIN as DECONZ_DOMAIN) + DEPENDENCIES = ['deconz'] ATTR_CURRENT = 'current' diff --git a/homeassistant/components/switch/deconz.py b/homeassistant/components/deconz/switch.py similarity index 98% rename from homeassistant/components/switch/deconz.py rename to homeassistant/components/deconz/switch.py index b491bc4b567..6c64fce5bd5 100644 --- a/homeassistant/components/switch/deconz.py +++ b/homeassistant/components/deconz/switch.py @@ -4,13 +4,14 @@ Support for deCONZ switches. For more details about this platform, please refer to the documentation at https://home-assistant.io/components/switch.deconz/ """ -from homeassistant.components.deconz.const import ( - DECONZ_REACHABLE, DOMAIN as DECONZ_DOMAIN, POWER_PLUGS, SIRENS) from homeassistant.components.switch import SwitchDevice from homeassistant.core import callback from homeassistant.helpers.device_registry import CONNECTION_ZIGBEE from homeassistant.helpers.dispatcher import async_dispatcher_connect +from .const import ( + DECONZ_REACHABLE, DOMAIN as DECONZ_DOMAIN, POWER_PLUGS, SIRENS) + DEPENDENCIES = ['deconz'] diff --git a/tests/components/binary_sensor/test_deconz.py b/tests/components/deconz/test_binary_sensor.py similarity index 100% rename from tests/components/binary_sensor/test_deconz.py rename to tests/components/deconz/test_binary_sensor.py diff --git a/tests/components/cover/test_deconz.py b/tests/components/deconz/test_cover.py similarity index 100% rename from tests/components/cover/test_deconz.py rename to tests/components/deconz/test_cover.py diff --git a/tests/components/light/test_deconz.py b/tests/components/deconz/test_light.py similarity index 100% rename from tests/components/light/test_deconz.py rename to tests/components/deconz/test_light.py diff --git a/tests/components/scene/test_deconz.py b/tests/components/deconz/test_scene.py similarity index 100% rename from tests/components/scene/test_deconz.py rename to tests/components/deconz/test_scene.py diff --git a/tests/components/sensor/test_deconz.py b/tests/components/deconz/test_sensor.py similarity index 100% rename from tests/components/sensor/test_deconz.py rename to tests/components/deconz/test_sensor.py diff --git a/tests/components/switch/test_deconz.py b/tests/components/deconz/test_switch.py similarity index 100% rename from tests/components/switch/test_deconz.py rename to tests/components/deconz/test_switch.py