From ba2160804222c8aa2426ab627150b1320b5590a0 Mon Sep 17 00:00:00 2001 From: "David F. Mulcahey" Date: Fri, 11 Jan 2019 23:34:48 -0500 Subject: [PATCH] Repackage ZHA component (#19989) * move files * rename files * rename files * move files * relative import * update coveragerc --- .coveragerc | 5 +++++ .../{binary_sensor/zha.py => zha/binary_sensor.py} | 0 homeassistant/components/zha/const.py | 4 ++-- homeassistant/components/{fan/zha.py => zha/fan.py} | 0 homeassistant/components/{light/zha.py => zha/light.py} | 0 homeassistant/components/{sensor/zha.py => zha/sensor.py} | 0 homeassistant/components/{switch/zha.py => zha/switch.py} | 0 7 files changed, 7 insertions(+), 2 deletions(-) rename homeassistant/components/{binary_sensor/zha.py => zha/binary_sensor.py} (100%) rename homeassistant/components/{fan/zha.py => zha/fan.py} (100%) rename homeassistant/components/{light/zha.py => zha/light.py} (100%) rename homeassistant/components/{sensor/zha.py => zha/sensor.py} (100%) rename homeassistant/components/{switch/zha.py => zha/switch.py} (100%) diff --git a/.coveragerc b/.coveragerc index f062501bd35..568dfd79386 100644 --- a/.coveragerc +++ b/.coveragerc @@ -424,8 +424,13 @@ omit = homeassistant/components/*/zabbix.py homeassistant/components/zha/__init__.py + homeassistant/components/zha/binary_sensor.py homeassistant/components/zha/const.py homeassistant/components/zha/event.py + homeassistant/components/zha/fan.py + homeassistant/components/zha/light.py + homeassistant/components/zha/sensor.py + homeassistant/components/zha/switch.py homeassistant/components/zha/api.py homeassistant/components/zha/entities/* homeassistant/components/zha/helpers.py diff --git a/homeassistant/components/binary_sensor/zha.py b/homeassistant/components/zha/binary_sensor.py similarity index 100% rename from homeassistant/components/binary_sensor/zha.py rename to homeassistant/components/zha/binary_sensor.py diff --git a/homeassistant/components/zha/const.py b/homeassistant/components/zha/const.py index 29295e35060..ebcf020a9b8 100644 --- a/homeassistant/components/zha/const.py +++ b/homeassistant/components/zha/const.py @@ -102,7 +102,7 @@ def populate_data(): """ from zigpy import zcl, quirks from zigpy.profiles import PROFILES, zha, zll - from homeassistant.components.sensor import zha as sensor_zha + from .sensor import RelativeHumiditySensor if zha.PROFILE_ID not in DEVICE_CLASS: DEVICE_CLASS[zha.PROFILE_ID] = {} @@ -162,7 +162,7 @@ def populate_data(): # A map of device/cluster to component/sub-component CUSTOM_CLUSTER_MAPPINGS.update({ (quirks.smartthings.SmartthingsTemperatureHumiditySensor, 64581): - ('sensor', sensor_zha.RelativeHumiditySensor) + ('sensor', RelativeHumiditySensor) }) # A map of hass components to all Zigbee clusters it could use diff --git a/homeassistant/components/fan/zha.py b/homeassistant/components/zha/fan.py similarity index 100% rename from homeassistant/components/fan/zha.py rename to homeassistant/components/zha/fan.py diff --git a/homeassistant/components/light/zha.py b/homeassistant/components/zha/light.py similarity index 100% rename from homeassistant/components/light/zha.py rename to homeassistant/components/zha/light.py diff --git a/homeassistant/components/sensor/zha.py b/homeassistant/components/zha/sensor.py similarity index 100% rename from homeassistant/components/sensor/zha.py rename to homeassistant/components/zha/sensor.py diff --git a/homeassistant/components/switch/zha.py b/homeassistant/components/zha/switch.py similarity index 100% rename from homeassistant/components/switch/zha.py rename to homeassistant/components/zha/switch.py