Add room hint support to Google Assistant cloud (#14180)

pull/14207/head
Paulus Schoutsen 2018-04-30 15:05:29 -04:00 committed by Pascal Vizeli
parent 6e0a3abf66
commit 12dff5baa8
2 changed files with 6 additions and 2 deletions

View File

@ -21,6 +21,7 @@ from homeassistant.helpers.aiohttp_client import async_get_clientsession
from homeassistant.util import dt as dt_util
from homeassistant.components.alexa import smart_home as alexa_sh
from homeassistant.components.google_assistant import helpers as ga_h
from homeassistant.components.google_assistant import const as ga_c
from . import http_api, iot
from .const import CONFIG_DIR, DOMAIN, SERVERS
@ -52,7 +53,8 @@ ALEXA_ENTITY_SCHEMA = vol.Schema({
GOOGLE_ENTITY_SCHEMA = vol.Schema({
vol.Optional(CONF_NAME): cv.string,
vol.Optional(CONF_ALIASES): vol.All(cv.ensure_list, [cv.string])
vol.Optional(CONF_ALIASES): vol.All(cv.ensure_list, [cv.string]),
vol.Optional(ga_c.CONF_ROOM_HINT): cv.string,
})
ASSISTANT_SCHEMA = vol.Schema({

View File

@ -318,7 +318,8 @@ def test_handler_google_actions(hass):
'entity_config': {
'switch.test': {
'name': 'Config name',
'aliases': 'Config alias'
'aliases': 'Config alias',
'room': 'living room'
}
}
}
@ -347,6 +348,7 @@ def test_handler_google_actions(hass):
assert device['name']['name'] == 'Config name'
assert device['name']['nicknames'] == ['Config alias']
assert device['type'] == 'action.devices.types.SWITCH'
assert device['roomHint'] == 'living room'
async def test_refresh_token_expired(hass):