Fix device_registry cleanup behavior (#35977)

* Fix: Only decives which are not referenced by an entity or a config_entry are removed

* Adapted test for async_cleanup

* Changed variable names
This commit is contained in:
Andre Lengwenus authored and GitHub committed 2020-05-23 09:46:03 +02:00
1 parent f1b91b050c
commit 919f3243de
2 files changed
+14 -6

No files matched your search

+1 -1
View File
@@ -539,7 +539,7 @@ async def test_cleanup_device_registry(hass, registry):
device_registry.async_cleanup(hass, registry, ent_reg)
assert registry.async_get_device({("hue", "d1")}, set()) is not None
assert registry.async_get_device({("hue", "d2")}, set()) is None
assert registry.async_get_device({("hue", "d2")}, set()) is not None
assert registry.async_get_device({("hue", "d3")}, set()) is not None
assert registry.async_get_device({("something", "d4")}, set()) is None