Move remaining of ZHA imports to top level. (#28071)

* Move ZHA import to top level.
* ZHA tests: move imports to top level.
This commit is contained in:
Alexei Chetroi authored and GitHub committed 2019-10-21 19:30:56 -04:00
1 parent fc8920646b
commit fe7c45b363
20 files changed
+261 -272

No files matched your search

+10 -17
View File
@@ -2,7 +2,8 @@
from datetime import timedelta
import time
from zigpy.zcl.foundation import Command
import zigpy.zcl.clusters.general as general
import zigpy.zcl.foundation as zcl_f
from homeassistant.components.device_tracker import DOMAIN, SOURCE_TYPE_ROUTER
from homeassistant.components.zha.core.registries import (
@@ -25,26 +26,18 @@ from tests.common import async_fire_time_changed
async def test_device_tracker(hass, config_entry, zha_gateway):
"""Test zha device tracker platform."""
from zigpy.zcl.clusters.general import (
Basic,
PowerConfiguration,
BinaryInput,
Identify,
Ota,
PollControl,
)
# create zigpy device
zigpy_device = await async_init_zigpy_device(
hass,
[
Basic.cluster_id,
PowerConfiguration.cluster_id,
Identify.cluster_id,
PollControl.cluster_id,
BinaryInput.cluster_id,
general.Basic.cluster_id,
general.PowerConfiguration.cluster_id,
general.Identify.cluster_id,
general.PollControl.cluster_id,
general.BinaryInput.cluster_id,
],
[Identify.cluster_id, Ota.cluster_id],
[general.Identify.cluster_id, general.Ota.cluster_id],
SMARTTHINGS_ARRIVAL_SENSOR_DEVICE_TYPE,
zha_gateway,
)
@@ -73,7 +66,7 @@ async def test_device_tracker(hass, config_entry, zha_gateway):
# turn state flip
attr = make_attribute(0x0020, 23)
hdr = make_zcl_header(Command.Report_Attributes)
hdr = make_zcl_header(zcl_f.Command.Report_Attributes)
cluster.handle_message(hdr, [[attr]])
attr = make_attribute(0x0021, 200)
@@ -96,7 +89,7 @@ async def test_device_tracker(hass, config_entry, zha_gateway):
await async_test_device_join(
hass,
zha_gateway,
PowerConfiguration.cluster_id,
general.PowerConfiguration.cluster_id,
DOMAIN,
SMARTTHINGS_ARRIVAL_SENSOR_DEVICE_TYPE,
)