From 38576e5b740acb02407676189f4d7d85e986c113 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Mariusz=20=C5=81uci=C3=B3w?= Date: Sun, 28 Oct 2018 14:53:47 +0100 Subject: [PATCH] Corrected fan device type in google assistant to fan (#17792) --- homeassistant/components/google_assistant/const.py | 1 + homeassistant/components/google_assistant/smart_home.py | 4 ++-- tests/components/google_assistant/__init__.py | 4 ++-- 3 files changed, 5 insertions(+), 4 deletions(-) diff --git a/homeassistant/components/google_assistant/const.py b/homeassistant/components/google_assistant/const.py index 7d9fa44442c..2f54ee33f77 100644 --- a/homeassistant/components/google_assistant/const.py +++ b/homeassistant/components/google_assistant/const.py @@ -25,6 +25,7 @@ TYPE_LIGHT = PREFIX_TYPES + 'LIGHT' TYPE_SWITCH = PREFIX_TYPES + 'SWITCH' TYPE_VACUUM = PREFIX_TYPES + 'VACUUM' TYPE_SCENE = PREFIX_TYPES + 'SCENE' +TYPE_FAN = PREFIX_TYPES + 'FAN' TYPE_THERMOSTAT = PREFIX_TYPES + 'THERMOSTAT' SERVICE_REQUEST_SYNC = 'request_sync' diff --git a/homeassistant/components/google_assistant/smart_home.py b/homeassistant/components/google_assistant/smart_home.py index da6211b1911..633e6258c03 100644 --- a/homeassistant/components/google_assistant/smart_home.py +++ b/homeassistant/components/google_assistant/smart_home.py @@ -25,7 +25,7 @@ from homeassistant.components import ( from . import trait from .const import ( TYPE_LIGHT, TYPE_SCENE, TYPE_SWITCH, TYPE_VACUUM, - TYPE_THERMOSTAT, + TYPE_THERMOSTAT, TYPE_FAN, CONF_ALIASES, CONF_ROOM_HINT, ERR_NOT_SUPPORTED, ERR_PROTOCOL_ERROR, ERR_DEVICE_OFFLINE, ERR_UNKNOWN_ERROR @@ -38,7 +38,7 @@ _LOGGER = logging.getLogger(__name__) DOMAIN_TO_GOOGLE_TYPES = { climate.DOMAIN: TYPE_THERMOSTAT, cover.DOMAIN: TYPE_SWITCH, - fan.DOMAIN: TYPE_SWITCH, + fan.DOMAIN: TYPE_FAN, group.DOMAIN: TYPE_SWITCH, input_boolean.DOMAIN: TYPE_SWITCH, light.DOMAIN: TYPE_LIGHT, diff --git a/tests/components/google_assistant/__init__.py b/tests/components/google_assistant/__init__.py index 6c4dd713b32..273a7e86505 100644 --- a/tests/components/google_assistant/__init__.py +++ b/tests/components/google_assistant/__init__.py @@ -184,7 +184,7 @@ DEMO_DEVICES = [{ 'name': 'Living Room Fan' }, 'traits': ['action.devices.traits.OnOff'], - 'type': 'action.devices.types.SWITCH', + 'type': 'action.devices.types.FAN', 'willReportState': False }, { 'id': 'fan.ceiling_fan', @@ -192,7 +192,7 @@ DEMO_DEVICES = [{ 'name': 'Ceiling Fan' }, 'traits': ['action.devices.traits.OnOff'], - 'type': 'action.devices.types.SWITCH', + 'type': 'action.devices.types.FAN', 'willReportState': False }, { 'id': 'group.all_fans',