mirror of
https://github.com/home-assistant/core.git
synced 2025-12-24 21:06:19 +00:00
Improve tracking of existing entities in deconz (#40265)
* Store all entities in dict * Use stored unique id to select if to create entity or not * Remove unnecessary init * Change so same physical sensor doesnt try to create multiple battery sensors Change so groups get created properly * Add controls in tests that entities are logged correctly
This commit is contained in:
@@ -67,6 +67,7 @@ async def test_no_covers(hass):
|
||||
"""Test that no cover entities are created."""
|
||||
gateway = await setup_deconz_integration(hass)
|
||||
assert len(gateway.deconz_ids) == 0
|
||||
assert len(gateway.entities[cover.DOMAIN]) == 0
|
||||
assert len(hass.states.async_all()) == 0
|
||||
|
||||
|
||||
@@ -81,6 +82,7 @@ async def test_cover(hass):
|
||||
assert "cover.deconz_old_brightness_cover" in gateway.deconz_ids
|
||||
assert "cover.window_covering_controller" in gateway.deconz_ids
|
||||
assert len(hass.states.async_all()) == 5
|
||||
assert len(gateway.entities[cover.DOMAIN]) == 4
|
||||
|
||||
level_controllable_cover = hass.states.get("cover.level_controllable_cover")
|
||||
assert level_controllable_cover.state == "open"
|
||||
@@ -158,3 +160,4 @@ async def test_cover(hass):
|
||||
await gateway.async_reset()
|
||||
|
||||
assert len(hass.states.async_all()) == 0
|
||||
assert len(gateway.entities[cover.DOMAIN]) == 0
|
||||
|
||||
Reference in New Issue
Block a user