From 1235dae5b8b9caa7342e4f92391697422c1e6ae9 Mon Sep 17 00:00:00 2001 From: Laqoore Date: Fri, 12 Jan 2018 00:01:38 +0100 Subject: [PATCH] Changed device type of media player and cover to switch (#11483) * Changed device type of media player and cover to switch Covers and media players should not be of device type 'light'. Example: If user requests all lights to switch to off, covers are closed and media players are affected too. * Fix test --- .../components/google_assistant/smart_home.py | 4 ++-- tests/components/google_assistant/__init__.py | 16 ++++++++-------- 2 files changed, 10 insertions(+), 10 deletions(-) diff --git a/homeassistant/components/google_assistant/smart_home.py b/homeassistant/components/google_assistant/smart_home.py index d6d5a4fd877..0faa9bdc484 100644 --- a/homeassistant/components/google_assistant/smart_home.py +++ b/homeassistant/components/google_assistant/smart_home.py @@ -54,12 +54,12 @@ MAPPING_COMPONENT = { } ], cover.DOMAIN: [ - TYPE_LIGHT, TRAIT_ONOFF, { + TYPE_SWITCH, TRAIT_ONOFF, { cover.SUPPORT_SET_POSITION: TRAIT_BRIGHTNESS } ], media_player.DOMAIN: [ - TYPE_LIGHT, TRAIT_ONOFF, { + TYPE_SWITCH, TRAIT_ONOFF, { media_player.SUPPORT_VOLUME_SET: TRAIT_BRIGHTNESS } ], diff --git a/tests/components/google_assistant/__init__.py b/tests/components/google_assistant/__init__.py index bcb12c70b58..eb8d17a83aa 100644 --- a/tests/components/google_assistant/__init__.py +++ b/tests/components/google_assistant/__init__.py @@ -95,7 +95,7 @@ DEMO_DEVICES = [{ 'traits': ['action.devices.traits.OnOff', 'action.devices.traits.Brightness'], 'type': - 'action.devices.types.LIGHT', + 'action.devices.types.SWITCH', 'willReportState': False }, { @@ -107,7 +107,7 @@ DEMO_DEVICES = [{ 'traits': ['action.devices.traits.OnOff', 'action.devices.traits.Brightness'], 'type': - 'action.devices.types.LIGHT', + 'action.devices.types.SWITCH', 'willReportState': False }, { @@ -116,7 +116,7 @@ DEMO_DEVICES = [{ 'name': 'Garage Door' }, 'traits': ['action.devices.traits.OnOff'], - 'type': 'action.devices.types.LIGHT', + 'type': 'action.devices.types.SWITCH', 'willReportState': False }, { 'id': 'cover.kitchen_window', @@ -124,7 +124,7 @@ DEMO_DEVICES = [{ 'name': 'Kitchen Window' }, 'traits': ['action.devices.traits.OnOff'], - 'type': 'action.devices.types.LIGHT', + 'type': 'action.devices.types.SWITCH', 'willReportState': False }, { 'id': 'group.all_covers', @@ -143,7 +143,7 @@ DEMO_DEVICES = [{ 'traits': ['action.devices.traits.OnOff', 'action.devices.traits.Brightness'], 'type': - 'action.devices.types.LIGHT', + 'action.devices.types.SWITCH', 'willReportState': False }, { @@ -155,7 +155,7 @@ DEMO_DEVICES = [{ 'traits': ['action.devices.traits.OnOff', 'action.devices.traits.Brightness'], 'type': - 'action.devices.types.LIGHT', + 'action.devices.types.SWITCH', 'willReportState': False }, { @@ -164,7 +164,7 @@ DEMO_DEVICES = [{ 'name': 'Lounge room' }, 'traits': ['action.devices.traits.OnOff'], - 'type': 'action.devices.types.LIGHT', + 'type': 'action.devices.types.SWITCH', 'willReportState': False }, { 'id': @@ -175,7 +175,7 @@ DEMO_DEVICES = [{ 'traits': ['action.devices.traits.OnOff', 'action.devices.traits.Brightness'], 'type': - 'action.devices.types.LIGHT', + 'action.devices.types.SWITCH', 'willReportState': False }, {