Switch default media_player device class to settop for google assistant (#36003)

This commit is contained in:
Joakim Plate 2020-05-27 08:16:21 +02:00 committed by GitHub
parent 879e2d1afd
commit ad6e21182e
No known key found for this signature in database
GPG key ID: 4AEE18F83AFDEB23
3 changed files with 7 additions and 6 deletions

View file

@ -73,6 +73,7 @@ TYPE_DOOR = f"{PREFIX_TYPES}DOOR"
TYPE_TV = f"{PREFIX_TYPES}TV"
TYPE_SPEAKER = f"{PREFIX_TYPES}SPEAKER"
TYPE_ALARM = f"{PREFIX_TYPES}SECURITYSYSTEM"
TYPE_SETTOP = f"{PREFIX_TYPES}SETTOP"
SERVICE_REQUEST_SYNC = "request_sync"
HOMEGRAPH_URL = "https://homegraph.googleapis.com/"
@ -114,7 +115,7 @@ DOMAIN_TO_GOOGLE_TYPES = {
input_boolean.DOMAIN: TYPE_SWITCH,
light.DOMAIN: TYPE_LIGHT,
lock.DOMAIN: TYPE_LOCK,
media_player.DOMAIN: TYPE_SWITCH,
media_player.DOMAIN: TYPE_SETTOP,
scene.DOMAIN: TYPE_SCENE,
script.DOMAIN: TYPE_SCENE,
switch.DOMAIN: TYPE_SWITCH,

View file

@ -168,7 +168,7 @@ DEMO_DEVICES = [
"action.devices.traits.Volume",
"action.devices.traits.Modes",
],
"type": "action.devices.types.SWITCH",
"type": "action.devices.types.SETTOP",
"willReportState": False,
},
{
@ -179,14 +179,14 @@ DEMO_DEVICES = [
"action.devices.traits.Volume",
"action.devices.traits.Modes",
],
"type": "action.devices.types.SWITCH",
"type": "action.devices.types.SETTOP",
"willReportState": False,
},
{
"id": "media_player.lounge_room",
"name": {"name": "Lounge room"},
"traits": ["action.devices.traits.OnOff", "action.devices.traits.Modes"],
"type": "action.devices.types.SWITCH",
"type": "action.devices.types.SETTOP",
"willReportState": False,
},
{
@ -197,7 +197,7 @@ DEMO_DEVICES = [
"action.devices.traits.Volume",
"action.devices.traits.Modes",
],
"type": "action.devices.types.SWITCH",
"type": "action.devices.types.SETTOP",
"willReportState": False,
},
{

View file

@ -743,7 +743,7 @@ async def test_device_class_cover(hass, device_class, google_type):
@pytest.mark.parametrize(
"device_class,google_type",
[
("non_existing_class", "action.devices.types.SWITCH"),
("non_existing_class", "action.devices.types.SETTOP"),
("tv", "action.devices.types.TV"),
],
)