core/tests/components/zha
Abílio Costa d49a436573
Delay ZHA group updates to ensure all members are updated first (#46861)
* Delay ZHA group updates to ensure all members are updated first

After turning off a group, when the first device reports "off", the
other devices may still be "on". If HA processes the group state update
quickly enough, the group will see that some devices are on, so the
state of the group will revert back to "on", and then "off" when the
remaining devices all report "off". That would cause the UI toggle to go
back and forward quickly, and automations that trigger with "state: on"
to fire when the user turns the group off.

This PR fixes that by delaying the group state update, giving time for
all the devices to report their states first.

* Fix zha group tests

* Reorder sleeping.

* Update tests/components/zha/common.py

Co-authored-by: Alexei Chetroi <lexoid@gmail.com>
2021-03-16 17:38:16 -04:00
..
__init__.py
common.py Delay ZHA group updates to ensure all members are updated first (#46861) 2021-03-16 17:38:16 -04:00
conftest.py
test_api.py
test_binary_sensor.py
test_channels.py
test_climate.py
test_config_flow.py
test_cover.py
test_device.py Update tests t-z to use async_get() instead of async_get_registry() (#47655) 2021-03-09 14:25:03 +01:00
test_device_action.py Update tests t-z to use async_get() instead of async_get_registry() (#47655) 2021-03-09 14:25:03 +01:00
test_device_tracker.py
test_device_trigger.py Update tests t-z to use async_get() instead of async_get_registry() (#47655) 2021-03-09 14:25:03 +01:00
test_discover.py Update tests t-z to use async_get() instead of async_get_registry() (#47655) 2021-03-09 14:25:03 +01:00
test_fan.py Delay ZHA group updates to ensure all members are updated first (#46861) 2021-03-16 17:38:16 -04:00
test_gateway.py
test_init.py
test_light.py Delay ZHA group updates to ensure all members are updated first (#46861) 2021-03-16 17:38:16 -04:00
test_lock.py
test_number.py
test_registries.py
test_sensor.py
test_switch.py Delay ZHA group updates to ensure all members are updated first (#46861) 2021-03-16 17:38:16 -04:00
zha_devices_list.py