diff --git a/homeassistant/components/google_assistant/http.py b/homeassistant/components/google_assistant/http.py index ab9705432fb..c339c8a4dc5 100644 --- a/homeassistant/components/google_assistant/http.py +++ b/homeassistant/components/google_assistant/http.py @@ -133,6 +133,8 @@ class GoogleAssistantView(HomeAssistantView): (service, service_data) = determine_service( eid, execution.get('command'), execution.get('params'), hass.config.units) + if domain == "group": + domain = "homeassistant" success = yield from hass.services.async_call( domain, service, service_data, blocking=True) result = {"ids": [eid], "states": {}} diff --git a/homeassistant/components/google_assistant/smart_home.py b/homeassistant/components/google_assistant/smart_home.py index 634d5074a0e..23876a068f9 100644 --- a/homeassistant/components/google_assistant/smart_home.py +++ b/homeassistant/components/google_assistant/smart_home.py @@ -39,7 +39,7 @@ _LOGGER = logging.getLogger(__name__) # Mapping is [actions schema, primary trait, optional features] # optional is SUPPORT_* = (trait, command) MAPPING_COMPONENT = { - group.DOMAIN: [TYPE_SCENE, TRAIT_SCENE, None], + group.DOMAIN: [TYPE_SWITCH, TRAIT_ONOFF, None], scene.DOMAIN: [TYPE_SCENE, TRAIT_SCENE, None], script.DOMAIN: [TYPE_SCENE, TRAIT_SCENE, None], switch.DOMAIN: [TYPE_SWITCH, TRAIT_ONOFF, None], @@ -94,10 +94,11 @@ def entity_to_device(entity: Entity, units: UnitSystem): # use aliases aliases = entity.attributes.get(CONF_ALIASES) - if isinstance(aliases, list): - device['name']['nicknames'] = aliases - else: - _LOGGER.warning("%s must be a list", CONF_ALIASES) + if aliases: + if isinstance(aliases, list): + device['name']['nicknames'] = aliases + else: + _LOGGER.warning("%s must be a list", CONF_ALIASES) # add trait if entity supports feature if class_data[2]: diff --git a/tests/components/google_assistant/__init__.py b/tests/components/google_assistant/__init__.py index f424fb92647..bcb12c70b58 100644 --- a/tests/components/google_assistant/__init__.py +++ b/tests/components/google_assistant/__init__.py @@ -75,16 +75,16 @@ DEMO_DEVICES = [{ 'name': { 'name': 'all lights' }, - 'traits': ['action.devices.traits.Scene'], - 'type': 'action.devices.types.SCENE', + 'traits': ['action.devices.traits.OnOff'], + 'type': 'action.devices.types.SWITCH', 'willReportState': False }, { 'id': 'group.all_switches', 'name': { 'name': 'all switches' }, - 'traits': ['action.devices.traits.Scene'], - 'type': 'action.devices.types.SCENE', + 'traits': ['action.devices.traits.OnOff'], + 'type': 'action.devices.types.SWITCH', 'willReportState': False }, { 'id': @@ -131,8 +131,8 @@ DEMO_DEVICES = [{ 'name': { 'name': 'all covers' }, - 'traits': ['action.devices.traits.Scene'], - 'type': 'action.devices.types.SCENE', + 'traits': ['action.devices.traits.OnOff'], + 'type': 'action.devices.types.SWITCH', 'willReportState': False }, { 'id': @@ -199,8 +199,8 @@ DEMO_DEVICES = [{ 'name': { 'name': 'all fans' }, - 'traits': ['action.devices.traits.Scene'], - 'type': 'action.devices.types.SCENE', + 'traits': ['action.devices.traits.OnOff'], + 'type': 'action.devices.types.SWITCH', 'willReportState': False }, { 'id': 'climate.hvac',