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,
|
"webhookId": self.config.local_sdk_webhook_id,
|
||||||
"httpPort": self.hass.http.server_port,
|
"httpPort": self.hass.http.server_port,
|
||||||
"httpSSL": self.hass.config.api.use_ssl,
|
"httpSSL": self.hass.config.api.use_ssl,
|
||||||
|
"uuid": await self.hass.helpers.instance_id.async_get(),
|
||||||
"baseUrl": get_url(self.hass, prefer_external=True),
|
"baseUrl": get_url(self.hass, prefer_external=True),
|
||||||
"proxyDeviceId": agent_user_id,
|
"proxyDeviceId": agent_user_id,
|
||||||
}
|
}
|
||||||
|
|
|
@ -44,15 +44,17 @@ async def test_google_entity_sync_serialize_with_local_sdk(hass):
|
||||||
|
|
||||||
config.async_enable_local_sdk()
|
config.async_enable_local_sdk()
|
||||||
|
|
||||||
serialized = await entity.sync_serialize(None)
|
with patch("homeassistant.helpers.instance_id.async_get", return_value="abcdef"):
|
||||||
assert serialized["otherDeviceIds"] == [{"deviceId": "light.ceiling_lights"}]
|
serialized = await entity.sync_serialize(None)
|
||||||
assert serialized["customData"] == {
|
assert serialized["otherDeviceIds"] == [{"deviceId": "light.ceiling_lights"}]
|
||||||
"httpPort": 1234,
|
assert serialized["customData"] == {
|
||||||
"httpSSL": True,
|
"httpPort": 1234,
|
||||||
"proxyDeviceId": None,
|
"httpSSL": True,
|
||||||
"webhookId": "mock-webhook-id",
|
"proxyDeviceId": None,
|
||||||
"baseUrl": "https://hostname:1234",
|
"webhookId": "mock-webhook-id",
|
||||||
}
|
"baseUrl": "https://hostname:1234",
|
||||||
|
"uuid": "abcdef",
|
||||||
|
}
|
||||||
|
|
||||||
for device_type in NOT_EXPOSE_LOCAL:
|
for device_type in NOT_EXPOSE_LOCAL:
|
||||||
with patch(
|
with patch(
|
||||||
|
|
Loading…
Add table
Add a link
Reference in a new issue