mirror of
https://github.com/home-assistant/core.git
synced 2025-07-21 12:17:07 +00:00
Remove unused custom data in Google Assistant (#79003)
This commit is contained in:
parent
e6f567a751
commit
d39ed0cde4
@ -11,6 +11,7 @@ import pprint
|
|||||||
|
|
||||||
from aiohttp.web import json_response
|
from aiohttp.web import json_response
|
||||||
from awesomeversion import AwesomeVersion
|
from awesomeversion import AwesomeVersion
|
||||||
|
from yarl import URL
|
||||||
|
|
||||||
from homeassistant.components import webhook
|
from homeassistant.components import webhook
|
||||||
from homeassistant.const import (
|
from homeassistant.const import (
|
||||||
@ -610,12 +611,8 @@ class GoogleEntity:
|
|||||||
device["otherDeviceIds"] = [{"deviceId": self.entity_id}]
|
device["otherDeviceIds"] = [{"deviceId": self.entity_id}]
|
||||||
device["customData"] = {
|
device["customData"] = {
|
||||||
"webhookId": self.config.get_local_webhook_id(agent_user_id),
|
"webhookId": self.config.get_local_webhook_id(agent_user_id),
|
||||||
"httpPort": self.hass.http.server_port,
|
"httpPort": URL(get_url(self.hass, allow_external=False)).port,
|
||||||
"uuid": instance_uuid,
|
"uuid": instance_uuid,
|
||||||
# Below can be removed in HA 2022.9
|
|
||||||
"httpSSL": self.hass.config.api.use_ssl,
|
|
||||||
"baseUrl": get_url(self.hass, prefer_external=True),
|
|
||||||
"proxyDeviceId": agent_user_id,
|
|
||||||
}
|
}
|
||||||
|
|
||||||
# Add trait sync attributes
|
# Add trait sync attributes
|
||||||
|
@ -53,10 +53,7 @@ async def test_diagnostics(hass: core.HomeAssistant, hass_client: Any):
|
|||||||
"type": "action.devices.types.SWITCH",
|
"type": "action.devices.types.SWITCH",
|
||||||
"willReportState": False,
|
"willReportState": False,
|
||||||
"customData": {
|
"customData": {
|
||||||
"baseUrl": "**REDACTED**",
|
|
||||||
"httpPort": 8123,
|
"httpPort": 8123,
|
||||||
"httpSSL": False,
|
|
||||||
"proxyDeviceId": "**REDACTED**",
|
|
||||||
"uuid": "**REDACTED**",
|
"uuid": "**REDACTED**",
|
||||||
"webhookId": None,
|
"webhookId": None,
|
||||||
},
|
},
|
||||||
@ -70,10 +67,7 @@ async def test_diagnostics(hass: core.HomeAssistant, hass_client: Any):
|
|||||||
"type": "action.devices.types.OUTLET",
|
"type": "action.devices.types.OUTLET",
|
||||||
"willReportState": False,
|
"willReportState": False,
|
||||||
"customData": {
|
"customData": {
|
||||||
"baseUrl": "**REDACTED**",
|
|
||||||
"httpPort": 8123,
|
"httpPort": 8123,
|
||||||
"httpSSL": False,
|
|
||||||
"proxyDeviceId": "**REDACTED**",
|
|
||||||
"uuid": "**REDACTED**",
|
"uuid": "**REDACTED**",
|
||||||
"webhookId": None,
|
"webhookId": None,
|
||||||
},
|
},
|
||||||
|
@ -30,7 +30,7 @@ from tests.common import (
|
|||||||
async def test_google_entity_sync_serialize_with_local_sdk(hass):
|
async def test_google_entity_sync_serialize_with_local_sdk(hass):
|
||||||
"""Test sync serialize attributes of a GoogleEntity."""
|
"""Test sync serialize attributes of a GoogleEntity."""
|
||||||
hass.states.async_set("light.ceiling_lights", "off")
|
hass.states.async_set("light.ceiling_lights", "off")
|
||||||
hass.config.api = Mock(port=1234, use_ssl=False)
|
hass.config.api = Mock(port=1234, local_ip="192.168.123.123", use_ssl=False)
|
||||||
await async_process_ha_core_config(
|
await async_process_ha_core_config(
|
||||||
hass,
|
hass,
|
||||||
{"external_url": "https://hostname:1234"},
|
{"external_url": "https://hostname:1234"},
|
||||||
@ -57,10 +57,7 @@ async def test_google_entity_sync_serialize_with_local_sdk(hass):
|
|||||||
assert serialized["otherDeviceIds"] == [{"deviceId": "light.ceiling_lights"}]
|
assert serialized["otherDeviceIds"] == [{"deviceId": "light.ceiling_lights"}]
|
||||||
assert serialized["customData"] == {
|
assert serialized["customData"] == {
|
||||||
"httpPort": 1234,
|
"httpPort": 1234,
|
||||||
"httpSSL": False,
|
|
||||||
"proxyDeviceId": "mock-user-id",
|
|
||||||
"webhookId": "mock-webhook-id",
|
"webhookId": "mock-webhook-id",
|
||||||
"baseUrl": "https://hostname:1234",
|
|
||||||
"uuid": "abcdef",
|
"uuid": "abcdef",
|
||||||
}
|
}
|
||||||
|
|
||||||
|
Loading…
x
Reference in New Issue
Block a user