Switch media player to SWITCH type (#23914)

MEDIA device type is being rejected by google now.
This commit is contained in:
Joakim Plate 2019-05-16 22:34:40 +02:00 committed by Paulus Schoutsen
parent 49d6d7c656
commit c8cf06b8b7
3 changed files with 6 additions and 7 deletions

View File

@ -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,

View File

@ -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
}, { }, {

View File

@ -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'),
]) ])