mirror of
https://github.com/home-assistant/core.git
synced 2025-07-21 12:17:07 +00:00
Switch default media_player device class to settop for google assistant (#36003)
This commit is contained in:
parent
879e2d1afd
commit
ad6e21182e
@ -73,6 +73,7 @@ TYPE_DOOR = f"{PREFIX_TYPES}DOOR"
|
|||||||
TYPE_TV = f"{PREFIX_TYPES}TV"
|
TYPE_TV = f"{PREFIX_TYPES}TV"
|
||||||
TYPE_SPEAKER = f"{PREFIX_TYPES}SPEAKER"
|
TYPE_SPEAKER = f"{PREFIX_TYPES}SPEAKER"
|
||||||
TYPE_ALARM = f"{PREFIX_TYPES}SECURITYSYSTEM"
|
TYPE_ALARM = f"{PREFIX_TYPES}SECURITYSYSTEM"
|
||||||
|
TYPE_SETTOP = f"{PREFIX_TYPES}SETTOP"
|
||||||
|
|
||||||
SERVICE_REQUEST_SYNC = "request_sync"
|
SERVICE_REQUEST_SYNC = "request_sync"
|
||||||
HOMEGRAPH_URL = "https://homegraph.googleapis.com/"
|
HOMEGRAPH_URL = "https://homegraph.googleapis.com/"
|
||||||
@ -114,7 +115,7 @@ DOMAIN_TO_GOOGLE_TYPES = {
|
|||||||
input_boolean.DOMAIN: TYPE_SWITCH,
|
input_boolean.DOMAIN: TYPE_SWITCH,
|
||||||
light.DOMAIN: TYPE_LIGHT,
|
light.DOMAIN: TYPE_LIGHT,
|
||||||
lock.DOMAIN: TYPE_LOCK,
|
lock.DOMAIN: TYPE_LOCK,
|
||||||
media_player.DOMAIN: TYPE_SWITCH,
|
media_player.DOMAIN: TYPE_SETTOP,
|
||||||
scene.DOMAIN: TYPE_SCENE,
|
scene.DOMAIN: TYPE_SCENE,
|
||||||
script.DOMAIN: TYPE_SCENE,
|
script.DOMAIN: TYPE_SCENE,
|
||||||
switch.DOMAIN: TYPE_SWITCH,
|
switch.DOMAIN: TYPE_SWITCH,
|
||||||
|
@ -168,7 +168,7 @@ DEMO_DEVICES = [
|
|||||||
"action.devices.traits.Volume",
|
"action.devices.traits.Volume",
|
||||||
"action.devices.traits.Modes",
|
"action.devices.traits.Modes",
|
||||||
],
|
],
|
||||||
"type": "action.devices.types.SWITCH",
|
"type": "action.devices.types.SETTOP",
|
||||||
"willReportState": False,
|
"willReportState": False,
|
||||||
},
|
},
|
||||||
{
|
{
|
||||||
@ -179,14 +179,14 @@ DEMO_DEVICES = [
|
|||||||
"action.devices.traits.Volume",
|
"action.devices.traits.Volume",
|
||||||
"action.devices.traits.Modes",
|
"action.devices.traits.Modes",
|
||||||
],
|
],
|
||||||
"type": "action.devices.types.SWITCH",
|
"type": "action.devices.types.SETTOP",
|
||||||
"willReportState": False,
|
"willReportState": False,
|
||||||
},
|
},
|
||||||
{
|
{
|
||||||
"id": "media_player.lounge_room",
|
"id": "media_player.lounge_room",
|
||||||
"name": {"name": "Lounge room"},
|
"name": {"name": "Lounge room"},
|
||||||
"traits": ["action.devices.traits.OnOff", "action.devices.traits.Modes"],
|
"traits": ["action.devices.traits.OnOff", "action.devices.traits.Modes"],
|
||||||
"type": "action.devices.types.SWITCH",
|
"type": "action.devices.types.SETTOP",
|
||||||
"willReportState": False,
|
"willReportState": False,
|
||||||
},
|
},
|
||||||
{
|
{
|
||||||
@ -197,7 +197,7 @@ DEMO_DEVICES = [
|
|||||||
"action.devices.traits.Volume",
|
"action.devices.traits.Volume",
|
||||||
"action.devices.traits.Modes",
|
"action.devices.traits.Modes",
|
||||||
],
|
],
|
||||||
"type": "action.devices.types.SWITCH",
|
"type": "action.devices.types.SETTOP",
|
||||||
"willReportState": False,
|
"willReportState": False,
|
||||||
},
|
},
|
||||||
{
|
{
|
||||||
|
@ -743,7 +743,7 @@ async def test_device_class_cover(hass, device_class, google_type):
|
|||||||
@pytest.mark.parametrize(
|
@pytest.mark.parametrize(
|
||||||
"device_class,google_type",
|
"device_class,google_type",
|
||||||
[
|
[
|
||||||
("non_existing_class", "action.devices.types.SWITCH"),
|
("non_existing_class", "action.devices.types.SETTOP"),
|
||||||
("tv", "action.devices.types.TV"),
|
("tv", "action.devices.types.TV"),
|
||||||
],
|
],
|
||||||
)
|
)
|
||||||
|
Loading…
x
Reference in New Issue
Block a user