Google Assistant: Remove speaker type and earlier filter out devices from being locally exposed (#31830)

* Remove speaker type

* Do not expose locks or alarms to Google Local
This commit is contained in:
Paulus Schoutsen authored and GitHub committed 2020-02-14 15:28:11 -08:00
1 parent 52b045ed30
commit 4501471b8c
5 files changed
+27 -6

No files matched your search

@@ -7,6 +7,7 @@ import pytest
from homeassistant.components.google_assistant import helpers
from homeassistant.components.google_assistant.const import ( # noqa: F401
EVENT_COMMAND_RECEIVED,
NOT_EXPOSE_LOCAL,
)
from homeassistant.setup import async_setup_component
from homeassistant.util import dt
@@ -46,6 +47,15 @@ async def test_google_entity_sync_serialize_with_local_sdk(hass):
"webhookId": "mock-webhook-id",
}
for device_type in NOT_EXPOSE_LOCAL:
with patch(
"homeassistant.components.google_assistant.helpers.get_google_type",
return_value=device_type,
):
serialized = await entity.sync_serialize(None)
assert "otherDeviceIds" not in serialized
assert "customData" not in serialized
async def test_config_local_sdk(hass, hass_client):
"""Test the local SDK."""
@@ -682,7 +682,6 @@ async def test_device_class_cover(hass, device_class, google_type):
"device_class,google_type",
[
("non_existing_class", "action.devices.types.SWITCH"),
("speaker", "action.devices.types.SPEAKER"),
("tv", "action.devices.types.TV"),
],
)