Allow exposing entities not in the entity registry to assistants (#92363)

This commit is contained in:
Erik Montnemery 2023-05-02 22:08:09 +02:00 committed by GitHub
parent cc4e741cfa
commit e3c16e634b
No known key found for this signature in database
GPG key ID: 4AEE18F83AFDEB23
52 changed files with 563 additions and 224 deletions

View file

@ -49,13 +49,13 @@ async def test_google_entity_sync_serialize_with_local_sdk(hass: HomeAssistant)
)
entity = helpers.GoogleEntity(hass, config, hass.states.get("light.ceiling_lights"))
serialized = entity.sync_serialize(None, "mock-uuid")
serialized = await entity.sync_serialize(None, "mock-uuid")
assert "otherDeviceIds" not in serialized
assert "customData" not in serialized
config.async_enable_local_sdk()
serialized = entity.sync_serialize("mock-user-id", "abcdef")
serialized = await entity.sync_serialize("mock-user-id", "abcdef")
assert serialized["otherDeviceIds"] == [{"deviceId": "light.ceiling_lights"}]
assert serialized["customData"] == {
"httpPort": 1234,
@ -68,7 +68,7 @@ async def test_google_entity_sync_serialize_with_local_sdk(hass: HomeAssistant)
"homeassistant.components.google_assistant.helpers.get_google_type",
return_value=device_type,
):
serialized = entity.sync_serialize(None, "mock-uuid")
serialized = await entity.sync_serialize(None, "mock-uuid")
assert "otherDeviceIds" not in serialized
assert "customData" not in serialized