Add Neighbors & Endpoint Names to zha/devices reply (#40748)

* Add Neighbors & Endpoint Names to zha/devices reply.

* Remove unused const

* Add tests & correct const name.

* Change tests to use corresponding enum device_type
This commit is contained in:
Samantha authored and GitHub committed 2020-09-29 15:25:05 -04:00
1 parent a2d2b7842d
commit a8b68dc4f9
16 files changed
+97 -24

No files matched your search

+11 -2
View File
@@ -4,6 +4,7 @@ import time
from unittest import mock
import pytest
import zigpy.profiles.zha
import zigpy.zcl.clusters.general as general
import homeassistant.components.zha.core.device as zha_core_device
@@ -27,7 +28,11 @@ def zigpy_device(zigpy_device_mock):
in_clusters.append(general.Basic.cluster_id)
endpoints = {
3: {"in_clusters": in_clusters, "out_clusters": [], "device_type": 0}
3: {
"in_clusters": in_clusters,
"out_clusters": [],
"device_type": zigpy.profiles.zha.DeviceType.ON_OFF_SWITCH,
}
}
return zigpy_device_mock(endpoints)
@@ -44,7 +49,11 @@ def zigpy_device_mains(zigpy_device_mock):
in_clusters.append(general.Basic.cluster_id)
endpoints = {
3: {"in_clusters": in_clusters, "out_clusters": [], "device_type": 0}
3: {
"in_clusters": in_clusters,
"out_clusters": [],
"device_type": zigpy.profiles.zha.DeviceType.ON_OFF_SWITCH,
}
}
return zigpy_device_mock(
endpoints, node_descriptor=b"\x02@\x84_\x11\x7fd\x00\x00,d\x00\x00"