Delete devices / entities when we remove a config entry. (#23983)

* Remove device when last config entry removed

* Remove entities when config entry removed

* Update tests to use new behaviour
This commit is contained in:
Penny Wood 2019-05-19 17:41:39 +08:00 committed by Paulus Schoutsen
parent d7d83c683d
commit f991ec15f2
5 changed files with 27 additions and 13 deletions

View file

@ -261,9 +261,9 @@ async def test_remove_entry(hass, manager):
# Just Group all_lights
assert len(hass.states.async_all()) == 1
# Check that entity registry entry no longer references config_entry_id
entity_entry = list(ent_reg.entities.values())[0]
assert entity_entry.config_entry_id is None
# Check that entity registry entry has been removed
entity_entry_list = list(ent_reg.entities.values())
assert not entity_entry_list
async def test_remove_entry_handles_callback_error(hass, manager):