mirror of
https://github.com/home-assistant/core.git
synced 2025-07-22 04:37:06 +00:00
Bump up ZHA dependencies (#26746)
* Update ZHA to track zigpy changes. * Update ZHA dependencies. * Update tests. * Make coverage happy again.
This commit is contained in:
parent
911d289333
commit
9c0fbfd101
@ -762,6 +762,7 @@ omit =
|
|||||||
homeassistant/components/zha/core/device.py
|
homeassistant/components/zha/core/device.py
|
||||||
homeassistant/components/zha/core/gateway.py
|
homeassistant/components/zha/core/gateway.py
|
||||||
homeassistant/components/zha/core/helpers.py
|
homeassistant/components/zha/core/helpers.py
|
||||||
|
homeassistant/components/zha/core/patches.py
|
||||||
homeassistant/components/zha/core/registries.py
|
homeassistant/components/zha/core/registries.py
|
||||||
homeassistant/components/zha/device_entity.py
|
homeassistant/components/zha/device_entity.py
|
||||||
homeassistant/components/zha/entity.py
|
homeassistant/components/zha/entity.py
|
||||||
|
@ -310,7 +310,7 @@ class ZHAGateway:
|
|||||||
|
|
||||||
@callback
|
@callback
|
||||||
def async_device_became_available(
|
def async_device_became_available(
|
||||||
self, sender, is_reply, profile, cluster, src_ep, dst_ep, tsn, command_id, args
|
self, sender, profile, cluster, src_ep, dst_ep, message
|
||||||
):
|
):
|
||||||
"""Handle tasks when a device becomes available."""
|
"""Handle tasks when a device becomes available."""
|
||||||
self.async_update_device(sender)
|
self.async_update_device(sender)
|
||||||
|
@ -9,9 +9,7 @@ https://home-assistant.io/components/zha/
|
|||||||
def apply_application_controller_patch(zha_gateway):
|
def apply_application_controller_patch(zha_gateway):
|
||||||
"""Apply patches to ZHA objects."""
|
"""Apply patches to ZHA objects."""
|
||||||
# Patch handle_message until zigpy can provide an event here
|
# Patch handle_message until zigpy can provide an event here
|
||||||
def handle_message(
|
def handle_message(sender, profile, cluster, src_ep, dst_ep, message):
|
||||||
sender, is_reply, profile, cluster, src_ep, dst_ep, tsn, command_id, args
|
|
||||||
):
|
|
||||||
"""Handle message from a device."""
|
"""Handle message from a device."""
|
||||||
if (
|
if (
|
||||||
not sender.initializing
|
not sender.initializing
|
||||||
@ -19,18 +17,8 @@ def apply_application_controller_patch(zha_gateway):
|
|||||||
and not zha_gateway.devices[sender.ieee].available
|
and not zha_gateway.devices[sender.ieee].available
|
||||||
):
|
):
|
||||||
zha_gateway.async_device_became_available(
|
zha_gateway.async_device_became_available(
|
||||||
sender,
|
sender, profile, cluster, src_ep, dst_ep, message
|
||||||
is_reply,
|
|
||||||
profile,
|
|
||||||
cluster,
|
|
||||||
src_ep,
|
|
||||||
dst_ep,
|
|
||||||
tsn,
|
|
||||||
command_id,
|
|
||||||
args,
|
|
||||||
)
|
)
|
||||||
return sender.handle_message(
|
return sender.handle_message(profile, cluster, src_ep, dst_ep, message)
|
||||||
is_reply, profile, cluster, src_ep, dst_ep, tsn, command_id, args
|
|
||||||
)
|
|
||||||
|
|
||||||
zha_gateway.application_controller.handle_message = handle_message
|
zha_gateway.application_controller.handle_message = handle_message
|
||||||
|
@ -4,11 +4,11 @@
|
|||||||
"config_flow": true,
|
"config_flow": true,
|
||||||
"documentation": "https://www.home-assistant.io/components/zha",
|
"documentation": "https://www.home-assistant.io/components/zha",
|
||||||
"requirements": [
|
"requirements": [
|
||||||
"bellows-homeassistant==0.9.1",
|
"bellows-homeassistant==0.10.0",
|
||||||
"zha-quirks==0.0.23",
|
"zha-quirks==0.0.23",
|
||||||
"zigpy-deconz==0.3.0",
|
"zigpy-deconz==0.4.0",
|
||||||
"zigpy-homeassistant==0.8.0",
|
"zigpy-homeassistant==0.9.0",
|
||||||
"zigpy-xbee-homeassistant==0.4.0",
|
"zigpy-xbee-homeassistant==0.5.0",
|
||||||
"zigpy-zigate==0.3.1"
|
"zigpy-zigate==0.3.1"
|
||||||
],
|
],
|
||||||
"dependencies": [],
|
"dependencies": [],
|
||||||
|
@ -267,7 +267,7 @@ beautifulsoup4==4.8.0
|
|||||||
beewi_smartclim==0.0.7
|
beewi_smartclim==0.0.7
|
||||||
|
|
||||||
# homeassistant.components.zha
|
# homeassistant.components.zha
|
||||||
bellows-homeassistant==0.9.1
|
bellows-homeassistant==0.10.0
|
||||||
|
|
||||||
# homeassistant.components.bmw_connected_drive
|
# homeassistant.components.bmw_connected_drive
|
||||||
bimmer_connected==0.6.0
|
bimmer_connected==0.6.0
|
||||||
@ -2020,13 +2020,13 @@ zhong_hong_hvac==1.0.9
|
|||||||
ziggo-mediabox-xl==1.1.0
|
ziggo-mediabox-xl==1.1.0
|
||||||
|
|
||||||
# homeassistant.components.zha
|
# homeassistant.components.zha
|
||||||
zigpy-deconz==0.3.0
|
zigpy-deconz==0.4.0
|
||||||
|
|
||||||
# homeassistant.components.zha
|
# homeassistant.components.zha
|
||||||
zigpy-homeassistant==0.8.0
|
zigpy-homeassistant==0.9.0
|
||||||
|
|
||||||
# homeassistant.components.zha
|
# homeassistant.components.zha
|
||||||
zigpy-xbee-homeassistant==0.4.0
|
zigpy-xbee-homeassistant==0.5.0
|
||||||
|
|
||||||
# homeassistant.components.zha
|
# homeassistant.components.zha
|
||||||
zigpy-zigate==0.3.1
|
zigpy-zigate==0.3.1
|
||||||
|
@ -94,7 +94,7 @@ av==6.1.2
|
|||||||
axis==25
|
axis==25
|
||||||
|
|
||||||
# homeassistant.components.zha
|
# homeassistant.components.zha
|
||||||
bellows-homeassistant==0.9.1
|
bellows-homeassistant==0.10.0
|
||||||
|
|
||||||
# homeassistant.components.caldav
|
# homeassistant.components.caldav
|
||||||
caldav==0.6.1
|
caldav==0.6.1
|
||||||
@ -434,4 +434,4 @@ wakeonlan==1.1.6
|
|||||||
zeroconf==0.23.0
|
zeroconf==0.23.0
|
||||||
|
|
||||||
# homeassistant.components.zha
|
# homeassistant.components.zha
|
||||||
zigpy-homeassistant==0.8.0
|
zigpy-homeassistant==0.9.0
|
||||||
|
@ -74,13 +74,13 @@ async def async_test_binary_sensor_on_off(hass, cluster, entity_id):
|
|||||||
"""Test getting on and off messages for binary sensors."""
|
"""Test getting on and off messages for binary sensors."""
|
||||||
# binary sensor on
|
# binary sensor on
|
||||||
attr = make_attribute(0, 1)
|
attr = make_attribute(0, 1)
|
||||||
cluster.handle_message(False, 1, 0x0A, [[attr]])
|
cluster.handle_message(1, 0x0A, [[attr]])
|
||||||
await hass.async_block_till_done()
|
await hass.async_block_till_done()
|
||||||
assert hass.states.get(entity_id).state == STATE_ON
|
assert hass.states.get(entity_id).state == STATE_ON
|
||||||
|
|
||||||
# binary sensor off
|
# binary sensor off
|
||||||
attr.value.value = 0
|
attr.value.value = 0
|
||||||
cluster.handle_message(False, 0, 0x0A, [[attr]])
|
cluster.handle_message(0, 0x0A, [[attr]])
|
||||||
await hass.async_block_till_done()
|
await hass.async_block_till_done()
|
||||||
assert hass.states.get(entity_id).state == STATE_OFF
|
assert hass.states.get(entity_id).state == STATE_OFF
|
||||||
|
|
||||||
|
@ -67,10 +67,10 @@ async def test_device_tracker(hass, config_entry, zha_gateway):
|
|||||||
|
|
||||||
# turn state flip
|
# turn state flip
|
||||||
attr = make_attribute(0x0020, 23)
|
attr = make_attribute(0x0020, 23)
|
||||||
cluster.handle_message(False, 1, 0x0A, [[attr]])
|
cluster.handle_message(1, 0x0A, [[attr]])
|
||||||
|
|
||||||
attr = make_attribute(0x0021, 200)
|
attr = make_attribute(0x0021, 200)
|
||||||
cluster.handle_message(False, 1, 0x0A, [[attr]])
|
cluster.handle_message(1, 0x0A, [[attr]])
|
||||||
|
|
||||||
zigpy_device.last_seen = time.time() + 10
|
zigpy_device.last_seen = time.time() + 10
|
||||||
next_update = dt_util.utcnow() + timedelta(seconds=30)
|
next_update = dt_util.utcnow() + timedelta(seconds=30)
|
||||||
|
@ -44,13 +44,13 @@ async def test_fan(hass, config_entry, zha_gateway):
|
|||||||
|
|
||||||
# turn on at fan
|
# turn on at fan
|
||||||
attr = make_attribute(0, 1)
|
attr = make_attribute(0, 1)
|
||||||
cluster.handle_message(False, 1, 0x0A, [[attr]])
|
cluster.handle_message(1, 0x0A, [[attr]])
|
||||||
await hass.async_block_till_done()
|
await hass.async_block_till_done()
|
||||||
assert hass.states.get(entity_id).state == STATE_ON
|
assert hass.states.get(entity_id).state == STATE_ON
|
||||||
|
|
||||||
# turn off at fan
|
# turn off at fan
|
||||||
attr.value.value = 0
|
attr.value.value = 0
|
||||||
cluster.handle_message(False, 0, 0x0A, [[attr]])
|
cluster.handle_message(0, 0x0A, [[attr]])
|
||||||
await hass.async_block_till_done()
|
await hass.async_block_till_done()
|
||||||
assert hass.states.get(entity_id).state == STATE_OFF
|
assert hass.states.get(entity_id).state == STATE_OFF
|
||||||
|
|
||||||
|
@ -123,13 +123,13 @@ async def async_test_on_off_from_light(hass, cluster, entity_id):
|
|||||||
"""Test on off functionality from the light."""
|
"""Test on off functionality from the light."""
|
||||||
# turn on at light
|
# turn on at light
|
||||||
attr = make_attribute(0, 1)
|
attr = make_attribute(0, 1)
|
||||||
cluster.handle_message(False, 1, 0x0A, [[attr]])
|
cluster.handle_message(1, 0x0A, [[attr]])
|
||||||
await hass.async_block_till_done()
|
await hass.async_block_till_done()
|
||||||
assert hass.states.get(entity_id).state == STATE_ON
|
assert hass.states.get(entity_id).state == STATE_ON
|
||||||
|
|
||||||
# turn off at light
|
# turn off at light
|
||||||
attr.value.value = 0
|
attr.value.value = 0
|
||||||
cluster.handle_message(False, 0, 0x0A, [[attr]])
|
cluster.handle_message(0, 0x0A, [[attr]])
|
||||||
await hass.async_block_till_done()
|
await hass.async_block_till_done()
|
||||||
assert hass.states.get(entity_id).state == STATE_OFF
|
assert hass.states.get(entity_id).state == STATE_OFF
|
||||||
|
|
||||||
@ -138,7 +138,7 @@ async def async_test_on_from_light(hass, cluster, entity_id):
|
|||||||
"""Test on off functionality from the light."""
|
"""Test on off functionality from the light."""
|
||||||
# turn on at light
|
# turn on at light
|
||||||
attr = make_attribute(0, 1)
|
attr = make_attribute(0, 1)
|
||||||
cluster.handle_message(False, 1, 0x0A, [[attr]])
|
cluster.handle_message(1, 0x0A, [[attr]])
|
||||||
await hass.async_block_till_done()
|
await hass.async_block_till_done()
|
||||||
assert hass.states.get(entity_id).state == STATE_ON
|
assert hass.states.get(entity_id).state == STATE_ON
|
||||||
|
|
||||||
@ -243,7 +243,7 @@ async def async_test_level_on_off_from_hass(
|
|||||||
async def async_test_dimmer_from_light(hass, cluster, entity_id, level, expected_state):
|
async def async_test_dimmer_from_light(hass, cluster, entity_id, level, expected_state):
|
||||||
"""Test dimmer functionality from the light."""
|
"""Test dimmer functionality from the light."""
|
||||||
attr = make_attribute(0, level)
|
attr = make_attribute(0, level)
|
||||||
cluster.handle_message(False, 1, 0x0A, [[attr]])
|
cluster.handle_message(1, 0x0A, [[attr]])
|
||||||
await hass.async_block_till_done()
|
await hass.async_block_till_done()
|
||||||
assert hass.states.get(entity_id).state == expected_state
|
assert hass.states.get(entity_id).state == expected_state
|
||||||
# hass uses None for brightness of 0 in state attributes
|
# hass uses None for brightness of 0 in state attributes
|
||||||
|
@ -43,13 +43,13 @@ async def test_lock(hass, config_entry, zha_gateway):
|
|||||||
|
|
||||||
# set state to locked
|
# set state to locked
|
||||||
attr = make_attribute(0, 1)
|
attr = make_attribute(0, 1)
|
||||||
cluster.handle_message(False, 1, 0x0A, [[attr]])
|
cluster.handle_message(1, 0x0A, [[attr]])
|
||||||
await hass.async_block_till_done()
|
await hass.async_block_till_done()
|
||||||
assert hass.states.get(entity_id).state == STATE_LOCKED
|
assert hass.states.get(entity_id).state == STATE_LOCKED
|
||||||
|
|
||||||
# set state to unlocked
|
# set state to unlocked
|
||||||
attr.value.value = 2
|
attr.value.value = 2
|
||||||
cluster.handle_message(False, 0, 0x0A, [[attr]])
|
cluster.handle_message(0, 0x0A, [[attr]])
|
||||||
await hass.async_block_till_done()
|
await hass.async_block_till_done()
|
||||||
assert hass.states.get(entity_id).state == STATE_UNLOCKED
|
assert hass.states.get(entity_id).state == STATE_UNLOCKED
|
||||||
|
|
||||||
|
@ -177,7 +177,7 @@ async def send_attribute_report(hass, cluster, attrid, value):
|
|||||||
device is paired to the zigbee network.
|
device is paired to the zigbee network.
|
||||||
"""
|
"""
|
||||||
attr = make_attribute(attrid, value)
|
attr = make_attribute(attrid, value)
|
||||||
cluster.handle_message(False, 1, 0x0A, [[attr]])
|
cluster.handle_message(1, 0x0A, [[attr]])
|
||||||
await hass.async_block_till_done()
|
await hass.async_block_till_done()
|
||||||
|
|
||||||
|
|
||||||
|
@ -44,13 +44,13 @@ async def test_switch(hass, config_entry, zha_gateway):
|
|||||||
|
|
||||||
# turn on at switch
|
# turn on at switch
|
||||||
attr = make_attribute(0, 1)
|
attr = make_attribute(0, 1)
|
||||||
cluster.handle_message(False, 1, 0x0A, [[attr]])
|
cluster.handle_message(1, 0x0A, [[attr]])
|
||||||
await hass.async_block_till_done()
|
await hass.async_block_till_done()
|
||||||
assert hass.states.get(entity_id).state == STATE_ON
|
assert hass.states.get(entity_id).state == STATE_ON
|
||||||
|
|
||||||
# turn off at switch
|
# turn off at switch
|
||||||
attr.value.value = 0
|
attr.value.value = 0
|
||||||
cluster.handle_message(False, 0, 0x0A, [[attr]])
|
cluster.handle_message(0, 0x0A, [[attr]])
|
||||||
await hass.async_block_till_done()
|
await hass.async_block_till_done()
|
||||||
assert hass.states.get(entity_id).state == STATE_OFF
|
assert hass.states.get(entity_id).state == STATE_OFF
|
||||||
|
|
||||||
|
Loading…
x
Reference in New Issue
Block a user