Add uuid to google assistant (#35811)
This commit is contained in:
parent
b15bac595d
commit
e61280095e
2 changed files with 12 additions and 9 deletions
|
@ -426,6 +426,7 @@ class GoogleEntity:
|
|||
"webhookId": self.config.local_sdk_webhook_id,
|
||||
"httpPort": self.hass.http.server_port,
|
||||
"httpSSL": self.hass.config.api.use_ssl,
|
||||
"uuid": await self.hass.helpers.instance_id.async_get(),
|
||||
"baseUrl": get_url(self.hass, prefer_external=True),
|
||||
"proxyDeviceId": agent_user_id,
|
||||
}
|
||||
|
|
|
@ -44,15 +44,17 @@ async def test_google_entity_sync_serialize_with_local_sdk(hass):
|
|||
|
||||
config.async_enable_local_sdk()
|
||||
|
||||
serialized = await entity.sync_serialize(None)
|
||||
assert serialized["otherDeviceIds"] == [{"deviceId": "light.ceiling_lights"}]
|
||||
assert serialized["customData"] == {
|
||||
"httpPort": 1234,
|
||||
"httpSSL": True,
|
||||
"proxyDeviceId": None,
|
||||
"webhookId": "mock-webhook-id",
|
||||
"baseUrl": "https://hostname:1234",
|
||||
}
|
||||
with patch("homeassistant.helpers.instance_id.async_get", return_value="abcdef"):
|
||||
serialized = await entity.sync_serialize(None)
|
||||
assert serialized["otherDeviceIds"] == [{"deviceId": "light.ceiling_lights"}]
|
||||
assert serialized["customData"] == {
|
||||
"httpPort": 1234,
|
||||
"httpSSL": True,
|
||||
"proxyDeviceId": None,
|
||||
"webhookId": "mock-webhook-id",
|
||||
"baseUrl": "https://hostname:1234",
|
||||
"uuid": "abcdef",
|
||||
}
|
||||
|
||||
for device_type in NOT_EXPOSE_LOCAL:
|
||||
with patch(
|
||||
|
|
Loading…
Add table
Reference in a new issue