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:
1 parent
911d289333
commit
9c0fbfd101
13 files changed
+30
-41
No files matched your search
@@ -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."""
|
||||
# binary sensor on
|
||||
attr = make_attribute(0, 1)
|
||||
cluster.handle_message(False, 1, 0x0A, [[attr]])
|
||||
cluster.handle_message(1, 0x0A, [[attr]])
|
||||
await hass.async_block_till_done()
|
||||
assert hass.states.get(entity_id).state == STATE_ON
|
||||
|
||||
# binary sensor off
|
||||
attr.value.value = 0
|
||||
cluster.handle_message(False, 0, 0x0A, [[attr]])
|
||||
cluster.handle_message(0, 0x0A, [[attr]])
|
||||
await hass.async_block_till_done()
|
||||
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
|
||||
attr = make_attribute(0x0020, 23)
|
||||
cluster.handle_message(False, 1, 0x0A, [[attr]])
|
||||
cluster.handle_message(1, 0x0A, [[attr]])
|
||||
|
||||
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
|
||||
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
|
||||
attr = make_attribute(0, 1)
|
||||
cluster.handle_message(False, 1, 0x0A, [[attr]])
|
||||
cluster.handle_message(1, 0x0A, [[attr]])
|
||||
await hass.async_block_till_done()
|
||||
assert hass.states.get(entity_id).state == STATE_ON
|
||||
|
||||
# turn off at fan
|
||||
attr.value.value = 0
|
||||
cluster.handle_message(False, 0, 0x0A, [[attr]])
|
||||
cluster.handle_message(0, 0x0A, [[attr]])
|
||||
await hass.async_block_till_done()
|
||||
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."""
|
||||
# turn on at light
|
||||
attr = make_attribute(0, 1)
|
||||
cluster.handle_message(False, 1, 0x0A, [[attr]])
|
||||
cluster.handle_message(1, 0x0A, [[attr]])
|
||||
await hass.async_block_till_done()
|
||||
assert hass.states.get(entity_id).state == STATE_ON
|
||||
|
||||
# turn off at light
|
||||
attr.value.value = 0
|
||||
cluster.handle_message(False, 0, 0x0A, [[attr]])
|
||||
cluster.handle_message(0, 0x0A, [[attr]])
|
||||
await hass.async_block_till_done()
|
||||
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."""
|
||||
# turn on at light
|
||||
attr = make_attribute(0, 1)
|
||||
cluster.handle_message(False, 1, 0x0A, [[attr]])
|
||||
cluster.handle_message(1, 0x0A, [[attr]])
|
||||
await hass.async_block_till_done()
|
||||
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):
|
||||
"""Test dimmer functionality from the light."""
|
||||
attr = make_attribute(0, level)
|
||||
cluster.handle_message(False, 1, 0x0A, [[attr]])
|
||||
cluster.handle_message(1, 0x0A, [[attr]])
|
||||
await hass.async_block_till_done()
|
||||
assert hass.states.get(entity_id).state == expected_state
|
||||
# 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
|
||||
attr = make_attribute(0, 1)
|
||||
cluster.handle_message(False, 1, 0x0A, [[attr]])
|
||||
cluster.handle_message(1, 0x0A, [[attr]])
|
||||
await hass.async_block_till_done()
|
||||
assert hass.states.get(entity_id).state == STATE_LOCKED
|
||||
|
||||
# set state to unlocked
|
||||
attr.value.value = 2
|
||||
cluster.handle_message(False, 0, 0x0A, [[attr]])
|
||||
cluster.handle_message(0, 0x0A, [[attr]])
|
||||
await hass.async_block_till_done()
|
||||
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.
|
||||
"""
|
||||
attr = make_attribute(attrid, value)
|
||||
cluster.handle_message(False, 1, 0x0A, [[attr]])
|
||||
cluster.handle_message(1, 0x0A, [[attr]])
|
||||
await hass.async_block_till_done()
|
||||
|
||||
|
||||
|
||||
@@ -44,13 +44,13 @@ async def test_switch(hass, config_entry, zha_gateway):
|
||||
|
||||
# turn on at switch
|
||||
attr = make_attribute(0, 1)
|
||||
cluster.handle_message(False, 1, 0x0A, [[attr]])
|
||||
cluster.handle_message(1, 0x0A, [[attr]])
|
||||
await hass.async_block_till_done()
|
||||
assert hass.states.get(entity_id).state == STATE_ON
|
||||
|
||||
# turn off at switch
|
||||
attr.value.value = 0
|
||||
cluster.handle_message(False, 0, 0x0A, [[attr]])
|
||||
cluster.handle_message(0, 0x0A, [[attr]])
|
||||
await hass.async_block_till_done()
|
||||
assert hass.states.get(entity_id).state == STATE_OFF
|
||||
|
||||
|
||||
Reference in new issue
Block a user