mirror of
https://github.com/home-assistant/core.git
synced 2025-07-19 11:17:21 +00:00
Switch media player to SWITCH type (#23914)
MEDIA device type is being rejected by google now.
This commit is contained in:
parent
49d6d7c656
commit
c8cf06b8b7
@ -53,7 +53,6 @@ TYPE_SENSOR = PREFIX_TYPES + 'SENSOR'
|
|||||||
TYPE_DOOR = PREFIX_TYPES + 'DOOR'
|
TYPE_DOOR = PREFIX_TYPES + 'DOOR'
|
||||||
TYPE_TV = PREFIX_TYPES + 'TV'
|
TYPE_TV = PREFIX_TYPES + 'TV'
|
||||||
TYPE_SPEAKER = PREFIX_TYPES + 'SPEAKER'
|
TYPE_SPEAKER = PREFIX_TYPES + 'SPEAKER'
|
||||||
TYPE_MEDIA = PREFIX_TYPES + 'MEDIA'
|
|
||||||
|
|
||||||
SERVICE_REQUEST_SYNC = 'request_sync'
|
SERVICE_REQUEST_SYNC = 'request_sync'
|
||||||
HOMEGRAPH_URL = 'https://homegraph.googleapis.com/'
|
HOMEGRAPH_URL = 'https://homegraph.googleapis.com/'
|
||||||
@ -89,7 +88,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_MEDIA,
|
media_player.DOMAIN: TYPE_SWITCH,
|
||||||
scene.DOMAIN: TYPE_SCENE,
|
scene.DOMAIN: TYPE_SCENE,
|
||||||
script.DOMAIN: TYPE_SCENE,
|
script.DOMAIN: TYPE_SCENE,
|
||||||
switch.DOMAIN: TYPE_SWITCH,
|
switch.DOMAIN: TYPE_SWITCH,
|
||||||
|
@ -147,7 +147,7 @@ DEMO_DEVICES = [{
|
|||||||
'action.devices.traits.Modes'
|
'action.devices.traits.Modes'
|
||||||
],
|
],
|
||||||
'type':
|
'type':
|
||||||
'action.devices.types.MEDIA',
|
'action.devices.types.SWITCH',
|
||||||
'willReportState':
|
'willReportState':
|
||||||
False
|
False
|
||||||
}, {
|
}, {
|
||||||
@ -162,7 +162,7 @@ DEMO_DEVICES = [{
|
|||||||
'action.devices.traits.Modes'
|
'action.devices.traits.Modes'
|
||||||
],
|
],
|
||||||
'type':
|
'type':
|
||||||
'action.devices.types.MEDIA',
|
'action.devices.types.SWITCH',
|
||||||
'willReportState':
|
'willReportState':
|
||||||
False
|
False
|
||||||
}, {
|
}, {
|
||||||
@ -171,7 +171,7 @@ DEMO_DEVICES = [{
|
|||||||
'name': 'Lounge room'
|
'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.MEDIA',
|
'type': 'action.devices.types.SWITCH',
|
||||||
'willReportState': False
|
'willReportState': False
|
||||||
}, {
|
}, {
|
||||||
'id':
|
'id':
|
||||||
@ -182,7 +182,7 @@ DEMO_DEVICES = [{
|
|||||||
'traits':
|
'traits':
|
||||||
['action.devices.traits.OnOff', 'action.devices.traits.Volume'],
|
['action.devices.traits.OnOff', 'action.devices.traits.Volume'],
|
||||||
'type':
|
'type':
|
||||||
'action.devices.types.MEDIA',
|
'action.devices.types.SWITCH',
|
||||||
'willReportState':
|
'willReportState':
|
||||||
False
|
False
|
||||||
}, {
|
}, {
|
||||||
|
@ -686,7 +686,7 @@ async def test_device_class_cover(hass, device_class, google_type):
|
|||||||
|
|
||||||
|
|
||||||
@pytest.mark.parametrize("device_class,google_type", [
|
@pytest.mark.parametrize("device_class,google_type", [
|
||||||
('non_existing_class', 'action.devices.types.MEDIA'),
|
('non_existing_class', 'action.devices.types.SWITCH'),
|
||||||
('speaker', 'action.devices.types.SPEAKER'),
|
('speaker', 'action.devices.types.SPEAKER'),
|
||||||
('tv', 'action.devices.types.TV'),
|
('tv', 'action.devices.types.TV'),
|
||||||
])
|
])
|
||||||
|
Loading…
x
Reference in New Issue
Block a user