Read min and max mireds from ZHA lights (#33983)

* implement min and max mireds

* remove unnecessary else

* additional light test

* add test to appease the codecov god

* change defaults
This commit is contained in:
David F. Mulcahey authored and GitHub committed 2020-04-10 23:19:17 -04:00
1 parent 44f8dab0b0
commit c1962a4895
4 files changed
+54 -5

No files matched your search

+9
View File
@@ -392,3 +392,12 @@ async def test_device_override(hass, zigpy_device_mock, setup_zha, override, ent
await zha_gateway.async_device_initialized(zigpy_device)
await hass.async_block_till_done()
assert hass.states.get(entity_id) is not None
async def test_group_probe_cleanup_called(hass, setup_zha, config_entry):
"""Test cleanup happens when zha is unloaded."""
await setup_zha()
disc.GROUP_PROBE.cleanup = mock.Mock(wraps=disc.GROUP_PROBE.cleanup)
await config_entry.async_unload(hass)
await hass.async_block_till_done()
disc.GROUP_PROBE.cleanup.assert_called()
+9
View File
@@ -552,6 +552,15 @@ async def async_test_zha_group_light_entity(
await dev3_cluster_on_off.on()
assert hass.states.get(entity_id).state == STATE_ON
# add a 3rd member and ensure we still have an entity and we track the new one
await dev1_cluster_on_off.off()
await dev3_cluster_on_off.off()
assert hass.states.get(entity_id).state == STATE_OFF
# this will test that _reprobe_group is used correctly
await zha_group.async_add_members([device_light_2.ieee])
await dev2_cluster_on_off.on()
assert hass.states.get(entity_id).state == STATE_ON
# remove the group and ensure that there is no entity and that the entity registry is cleaned up
assert zha_gateway.ha_entity_registry.async_get(entity_id) is not None
await zha_gateway.async_remove_zigpy_group(zha_group.group_id)