Prevent double ZHA channel initialization (#36554)

* Preven double channel initialization.

* Use a setter for setting ZHA device availability.
This commit is contained in:
Alexei Chetroi authored and GitHub committed 2020-06-08 08:54:52 -04:00
1 parent 8ed1b1782e
commit 1bdbe90d2a
9 files changed
+30 -26

No files matched your search

+3 -3
View File
@@ -56,7 +56,7 @@ async def coordinator(hass, zigpy_device_mock, zha_device_joined):
node_descriptor=b"\xf8\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff",
)
zha_device = await zha_device_joined(zigpy_device)
zha_device.set_available(True)
zha_device.available = True
return zha_device
@@ -75,7 +75,7 @@ async def device_switch_1(hass, zigpy_device_mock, zha_device_joined):
ieee=IEEE_GROUPABLE_DEVICE,
)
zha_device = await zha_device_joined(zigpy_device)
zha_device.set_available(True)
zha_device.available = True
return zha_device
@@ -94,7 +94,7 @@ async def device_switch_2(hass, zigpy_device_mock, zha_device_joined):
ieee=IEEE_GROUPABLE_DEVICE2,
)
zha_device = await zha_device_joined(zigpy_device)
zha_device.set_available(True)
zha_device.available = True
return zha_device