mirror of
https://github.com/home-assistant/core.git
synced 2025-07-08 05:47:10 +00:00
Bump ZHA to 0.0.54 (#141447)
* Bump ZHA to 0.0.54 * Add strings for v2 quirk entities * Adjust cover tests for new ZHA behavior * Improve cover tests further
This commit is contained in:
parent
e8158234a9
commit
02f8322ac1
@ -21,7 +21,7 @@
|
|||||||
"zha",
|
"zha",
|
||||||
"universal_silabs_flasher"
|
"universal_silabs_flasher"
|
||||||
],
|
],
|
||||||
"requirements": ["zha==0.0.53"],
|
"requirements": ["zha==0.0.54"],
|
||||||
"usb": [
|
"usb": [
|
||||||
{
|
{
|
||||||
"vid": "10C4",
|
"vid": "10C4",
|
||||||
|
@ -610,6 +610,12 @@
|
|||||||
},
|
},
|
||||||
"flow_switch": {
|
"flow_switch": {
|
||||||
"name": "Flow switch"
|
"name": "Flow switch"
|
||||||
|
},
|
||||||
|
"water_leak": {
|
||||||
|
"name": "Water leak"
|
||||||
|
},
|
||||||
|
"water_supply": {
|
||||||
|
"name": "Water supply"
|
||||||
}
|
}
|
||||||
},
|
},
|
||||||
"button": {
|
"button": {
|
||||||
@ -1101,6 +1107,27 @@
|
|||||||
},
|
},
|
||||||
"shutdown_timer": {
|
"shutdown_timer": {
|
||||||
"name": "Shutdown timer"
|
"name": "Shutdown timer"
|
||||||
|
},
|
||||||
|
"calibration_vertical_run_time_up": {
|
||||||
|
"name": "Calibration vertical run time up"
|
||||||
|
},
|
||||||
|
"calibration_vertical_run_time_down": {
|
||||||
|
"name": "Calibration vertical run time down"
|
||||||
|
},
|
||||||
|
"calibration_rotation_run_time_up": {
|
||||||
|
"name": "Calibration rotation run time up"
|
||||||
|
},
|
||||||
|
"calibration_rotation_run_time_down": {
|
||||||
|
"name": "Calibration rotation run time down"
|
||||||
|
},
|
||||||
|
"impulse_mode_duration": {
|
||||||
|
"name": "Impulse mode duration"
|
||||||
|
},
|
||||||
|
"water_duration": {
|
||||||
|
"name": "Water duration"
|
||||||
|
},
|
||||||
|
"water_interval": {
|
||||||
|
"name": "Water interval"
|
||||||
}
|
}
|
||||||
},
|
},
|
||||||
"select": {
|
"select": {
|
||||||
@ -1319,6 +1346,9 @@
|
|||||||
},
|
},
|
||||||
"hysteresis_mode": {
|
"hysteresis_mode": {
|
||||||
"name": "Hysteresis mode"
|
"name": "Hysteresis mode"
|
||||||
|
},
|
||||||
|
"speed": {
|
||||||
|
"name": "Speed"
|
||||||
}
|
}
|
||||||
},
|
},
|
||||||
"sensor": {
|
"sensor": {
|
||||||
@ -1666,6 +1696,9 @@
|
|||||||
},
|
},
|
||||||
"last_watering_duration": {
|
"last_watering_duration": {
|
||||||
"name": "Last watering duration"
|
"name": "Last watering duration"
|
||||||
|
},
|
||||||
|
"device_status": {
|
||||||
|
"name": "Device status"
|
||||||
}
|
}
|
||||||
},
|
},
|
||||||
"switch": {
|
"switch": {
|
||||||
|
2
requirements_all.txt
generated
2
requirements_all.txt
generated
@ -3152,7 +3152,7 @@ zeroconf==0.146.0
|
|||||||
zeversolar==0.3.2
|
zeversolar==0.3.2
|
||||||
|
|
||||||
# homeassistant.components.zha
|
# homeassistant.components.zha
|
||||||
zha==0.0.53
|
zha==0.0.54
|
||||||
|
|
||||||
# homeassistant.components.zhong_hong
|
# homeassistant.components.zhong_hong
|
||||||
zhong-hong-hvac==1.0.13
|
zhong-hong-hvac==1.0.13
|
||||||
|
2
requirements_test_all.txt
generated
2
requirements_test_all.txt
generated
@ -2542,7 +2542,7 @@ zeroconf==0.146.0
|
|||||||
zeversolar==0.3.2
|
zeversolar==0.3.2
|
||||||
|
|
||||||
# homeassistant.components.zha
|
# homeassistant.components.zha
|
||||||
zha==0.0.53
|
zha==0.0.54
|
||||||
|
|
||||||
# homeassistant.components.zwave_js
|
# homeassistant.components.zwave_js
|
||||||
zwave-js-server-python==0.62.0
|
zwave-js-server-python==0.62.0
|
||||||
|
@ -81,7 +81,7 @@ async def test_cover(hass: HomeAssistant, setup_zha, zigpy_device_mock) -> None:
|
|||||||
cluster = zigpy_device.endpoints[1].window_covering
|
cluster = zigpy_device.endpoints[1].window_covering
|
||||||
cluster.PLUGGED_ATTR_READS = {
|
cluster.PLUGGED_ATTR_READS = {
|
||||||
WCAttrs.current_position_lift_percentage.name: 0,
|
WCAttrs.current_position_lift_percentage.name: 0,
|
||||||
WCAttrs.current_position_tilt_percentage.name: 42,
|
WCAttrs.current_position_tilt_percentage.name: 100,
|
||||||
WCAttrs.window_covering_type.name: WCT.Tilt_blind_tilt_and_lift,
|
WCAttrs.window_covering_type.name: WCT.Tilt_blind_tilt_and_lift,
|
||||||
WCAttrs.config_status.name: WCCS(~WCCS.Open_up_commands_reversed),
|
WCAttrs.config_status.name: WCCS(~WCCS.Open_up_commands_reversed),
|
||||||
}
|
}
|
||||||
@ -115,33 +115,33 @@ async def test_cover(hass: HomeAssistant, setup_zha, zigpy_device_mock) -> None:
|
|||||||
assert state
|
assert state
|
||||||
assert state.state == CoverState.OPEN
|
assert state.state == CoverState.OPEN
|
||||||
assert state.attributes[ATTR_CURRENT_POSITION] == 100
|
assert state.attributes[ATTR_CURRENT_POSITION] == 100
|
||||||
assert state.attributes[ATTR_CURRENT_TILT_POSITION] == 58
|
assert state.attributes[ATTR_CURRENT_TILT_POSITION] == 0
|
||||||
|
|
||||||
# test that the state has changed from unavailable to off
|
# test that the state has changed from open to closed
|
||||||
await send_attributes_report(
|
await send_attributes_report(
|
||||||
hass, cluster, {WCAttrs.current_position_lift_percentage.id: 100}
|
hass, cluster, {WCAttrs.current_position_lift_percentage.id: 100}
|
||||||
)
|
)
|
||||||
assert hass.states.get(entity_id).state == CoverState.CLOSED
|
assert hass.states.get(entity_id).state == CoverState.CLOSED
|
||||||
|
|
||||||
# test to see if it opens
|
# test that it opens
|
||||||
await send_attributes_report(
|
await send_attributes_report(
|
||||||
hass, cluster, {WCAttrs.current_position_lift_percentage.id: 0}
|
hass, cluster, {WCAttrs.current_position_lift_percentage.id: 0}
|
||||||
)
|
)
|
||||||
assert hass.states.get(entity_id).state == CoverState.OPEN
|
assert hass.states.get(entity_id).state == CoverState.OPEN
|
||||||
|
|
||||||
# test that the state remains after tilting to 100%
|
# test that the state remains after tilting to 0% (open)
|
||||||
await send_attributes_report(
|
|
||||||
hass, cluster, {WCAttrs.current_position_tilt_percentage.id: 100}
|
|
||||||
)
|
|
||||||
assert hass.states.get(entity_id).state == CoverState.OPEN
|
|
||||||
|
|
||||||
# test to see the state remains after tilting to 0%
|
|
||||||
await send_attributes_report(
|
await send_attributes_report(
|
||||||
hass, cluster, {WCAttrs.current_position_tilt_percentage.id: 0}
|
hass, cluster, {WCAttrs.current_position_tilt_percentage.id: 0}
|
||||||
)
|
)
|
||||||
assert hass.states.get(entity_id).state == CoverState.OPEN
|
assert hass.states.get(entity_id).state == CoverState.OPEN
|
||||||
|
|
||||||
# close from UI
|
# test that the state remains after tilting to 100% (closed)
|
||||||
|
await send_attributes_report(
|
||||||
|
hass, cluster, {WCAttrs.current_position_tilt_percentage.id: 100}
|
||||||
|
)
|
||||||
|
assert hass.states.get(entity_id).state == CoverState.OPEN
|
||||||
|
|
||||||
|
# close lift from UI
|
||||||
with patch("zigpy.zcl.Cluster.request", return_value=[0x1, zcl_f.Status.SUCCESS]):
|
with patch("zigpy.zcl.Cluster.request", return_value=[0x1, zcl_f.Status.SUCCESS]):
|
||||||
await hass.services.async_call(
|
await hass.services.async_call(
|
||||||
COVER_DOMAIN, SERVICE_CLOSE_COVER, {"entity_id": entity_id}, blocking=True
|
COVER_DOMAIN, SERVICE_CLOSE_COVER, {"entity_id": entity_id}, blocking=True
|
||||||
@ -160,6 +160,11 @@ async def test_cover(hass: HomeAssistant, setup_zha, zigpy_device_mock) -> None:
|
|||||||
|
|
||||||
assert hass.states.get(entity_id).state == CoverState.CLOSED
|
assert hass.states.get(entity_id).state == CoverState.CLOSED
|
||||||
|
|
||||||
|
# close tilt from UI, needs re-opening first
|
||||||
|
await send_attributes_report(
|
||||||
|
hass, cluster, {WCAttrs.current_position_tilt_percentage.id: 0}
|
||||||
|
)
|
||||||
|
assert hass.states.get(entity_id).state == CoverState.OPEN
|
||||||
with patch("zigpy.zcl.Cluster.request", return_value=[0x1, zcl_f.Status.SUCCESS]):
|
with patch("zigpy.zcl.Cluster.request", return_value=[0x1, zcl_f.Status.SUCCESS]):
|
||||||
await hass.services.async_call(
|
await hass.services.async_call(
|
||||||
COVER_DOMAIN,
|
COVER_DOMAIN,
|
||||||
@ -185,7 +190,7 @@ async def test_cover(hass: HomeAssistant, setup_zha, zigpy_device_mock) -> None:
|
|||||||
|
|
||||||
assert hass.states.get(entity_id).state == CoverState.CLOSED
|
assert hass.states.get(entity_id).state == CoverState.CLOSED
|
||||||
|
|
||||||
# open from UI
|
# open lift from UI
|
||||||
with patch("zigpy.zcl.Cluster.request", return_value=[0x0, zcl_f.Status.SUCCESS]):
|
with patch("zigpy.zcl.Cluster.request", return_value=[0x0, zcl_f.Status.SUCCESS]):
|
||||||
await hass.services.async_call(
|
await hass.services.async_call(
|
||||||
COVER_DOMAIN, SERVICE_OPEN_COVER, {"entity_id": entity_id}, blocking=True
|
COVER_DOMAIN, SERVICE_OPEN_COVER, {"entity_id": entity_id}, blocking=True
|
||||||
@ -204,6 +209,7 @@ async def test_cover(hass: HomeAssistant, setup_zha, zigpy_device_mock) -> None:
|
|||||||
|
|
||||||
assert hass.states.get(entity_id).state == CoverState.OPEN
|
assert hass.states.get(entity_id).state == CoverState.OPEN
|
||||||
|
|
||||||
|
# open tilt from UI
|
||||||
with patch("zigpy.zcl.Cluster.request", return_value=[0x0, zcl_f.Status.SUCCESS]):
|
with patch("zigpy.zcl.Cluster.request", return_value=[0x0, zcl_f.Status.SUCCESS]):
|
||||||
await hass.services.async_call(
|
await hass.services.async_call(
|
||||||
COVER_DOMAIN,
|
COVER_DOMAIN,
|
||||||
@ -229,7 +235,7 @@ async def test_cover(hass: HomeAssistant, setup_zha, zigpy_device_mock) -> None:
|
|||||||
|
|
||||||
assert hass.states.get(entity_id).state == CoverState.OPEN
|
assert hass.states.get(entity_id).state == CoverState.OPEN
|
||||||
|
|
||||||
# set position UI
|
# set lift position from UI
|
||||||
with patch("zigpy.zcl.Cluster.request", return_value=[0x5, zcl_f.Status.SUCCESS]):
|
with patch("zigpy.zcl.Cluster.request", return_value=[0x5, zcl_f.Status.SUCCESS]):
|
||||||
await hass.services.async_call(
|
await hass.services.async_call(
|
||||||
COVER_DOMAIN,
|
COVER_DOMAIN,
|
||||||
@ -261,6 +267,7 @@ async def test_cover(hass: HomeAssistant, setup_zha, zigpy_device_mock) -> None:
|
|||||||
|
|
||||||
assert hass.states.get(entity_id).state == CoverState.OPEN
|
assert hass.states.get(entity_id).state == CoverState.OPEN
|
||||||
|
|
||||||
|
# set tilt position from UI
|
||||||
with patch("zigpy.zcl.Cluster.request", return_value=[0x5, zcl_f.Status.SUCCESS]):
|
with patch("zigpy.zcl.Cluster.request", return_value=[0x5, zcl_f.Status.SUCCESS]):
|
||||||
await hass.services.async_call(
|
await hass.services.async_call(
|
||||||
COVER_DOMAIN,
|
COVER_DOMAIN,
|
||||||
@ -281,13 +288,13 @@ async def test_cover(hass: HomeAssistant, setup_zha, zigpy_device_mock) -> None:
|
|||||||
assert hass.states.get(entity_id).state == CoverState.CLOSING
|
assert hass.states.get(entity_id).state == CoverState.CLOSING
|
||||||
|
|
||||||
await send_attributes_report(
|
await send_attributes_report(
|
||||||
hass, cluster, {WCAttrs.current_position_lift_percentage.id: 35}
|
hass, cluster, {WCAttrs.current_position_tilt_percentage.id: 35}
|
||||||
)
|
)
|
||||||
|
|
||||||
assert hass.states.get(entity_id).state == CoverState.CLOSING
|
assert hass.states.get(entity_id).state == CoverState.CLOSING
|
||||||
|
|
||||||
await send_attributes_report(
|
await send_attributes_report(
|
||||||
hass, cluster, {WCAttrs.current_position_lift_percentage.id: 53}
|
hass, cluster, {WCAttrs.current_position_tilt_percentage.id: 53}
|
||||||
)
|
)
|
||||||
|
|
||||||
assert hass.states.get(entity_id).state == CoverState.OPEN
|
assert hass.states.get(entity_id).state == CoverState.OPEN
|
||||||
@ -338,7 +345,7 @@ async def test_cover_failures(
|
|||||||
# load up cover domain
|
# load up cover domain
|
||||||
cluster = zigpy_device.endpoints[1].window_covering
|
cluster = zigpy_device.endpoints[1].window_covering
|
||||||
cluster.PLUGGED_ATTR_READS = {
|
cluster.PLUGGED_ATTR_READS = {
|
||||||
WCAttrs.current_position_tilt_percentage.name: 42,
|
WCAttrs.current_position_tilt_percentage.name: 100,
|
||||||
WCAttrs.window_covering_type.name: WCT.Tilt_blind_tilt_and_lift,
|
WCAttrs.window_covering_type.name: WCT.Tilt_blind_tilt_and_lift,
|
||||||
}
|
}
|
||||||
update_attribute_cache(cluster)
|
update_attribute_cache(cluster)
|
||||||
@ -355,7 +362,7 @@ async def test_cover_failures(
|
|||||||
await send_attributes_report(hass, cluster, {0: 0, 8: 100, 1: 1})
|
await send_attributes_report(hass, cluster, {0: 0, 8: 100, 1: 1})
|
||||||
assert hass.states.get(entity_id).state == CoverState.CLOSED
|
assert hass.states.get(entity_id).state == CoverState.CLOSED
|
||||||
|
|
||||||
# test to see if it opens
|
# test that it opens
|
||||||
await send_attributes_report(hass, cluster, {0: 1, 8: 0, 1: 100})
|
await send_attributes_report(hass, cluster, {0: 1, 8: 0, 1: 100})
|
||||||
assert hass.states.get(entity_id).state == CoverState.OPEN
|
assert hass.states.get(entity_id).state == CoverState.OPEN
|
||||||
|
|
||||||
|
Loading…
x
Reference in New Issue
Block a user