Ensure bond unique ids are unique across hubs (#38496)
This commit is contained in:
1 parent
ce71775722
commit
542c6cce25
6 files changed
+40
-10
No files matched your search
@@ -29,10 +29,17 @@ def generic_device(name: str):
|
||||
|
||||
async def test_entity_registry(hass: core.HomeAssistant):
|
||||
"""Tests that the devices are registered in the entity registry."""
|
||||
await setup_platform(hass, SWITCH_DOMAIN, generic_device("name-1"))
|
||||
await setup_platform(
|
||||
hass,
|
||||
SWITCH_DOMAIN,
|
||||
generic_device("name-1"),
|
||||
bond_version={"bondid": "test-hub-id"},
|
||||
bond_device_id="test-device-id",
|
||||
)
|
||||
|
||||
registry: EntityRegistry = await hass.helpers.entity_registry.async_get_registry()
|
||||
assert [key for key in registry.entities] == ["switch.name_1"]
|
||||
entity = registry.entities["switch.name_1"]
|
||||
assert entity.unique_id == "test-hub-id_test-device-id"
|
||||
|
||||
|
||||
async def test_turn_on_switch(hass: core.HomeAssistant):
|
||||
|
||||
Reference in new issue
Block a user