mirror of
https://github.com/home-assistant/core.git
synced 2025-07-23 21:27:38 +00:00
Add room hint support to Google Assistant cloud (#14180)
This commit is contained in:
parent
6e0a3abf66
commit
12dff5baa8
@ -21,6 +21,7 @@ from homeassistant.helpers.aiohttp_client import async_get_clientsession
|
|||||||
from homeassistant.util import dt as dt_util
|
from homeassistant.util import dt as dt_util
|
||||||
from homeassistant.components.alexa import smart_home as alexa_sh
|
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 helpers as ga_h
|
||||||
|
from homeassistant.components.google_assistant import const as ga_c
|
||||||
|
|
||||||
from . import http_api, iot
|
from . import http_api, iot
|
||||||
from .const import CONFIG_DIR, DOMAIN, SERVERS
|
from .const import CONFIG_DIR, DOMAIN, SERVERS
|
||||||
@ -52,7 +53,8 @@ ALEXA_ENTITY_SCHEMA = vol.Schema({
|
|||||||
|
|
||||||
GOOGLE_ENTITY_SCHEMA = vol.Schema({
|
GOOGLE_ENTITY_SCHEMA = vol.Schema({
|
||||||
vol.Optional(CONF_NAME): cv.string,
|
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({
|
ASSISTANT_SCHEMA = vol.Schema({
|
||||||
|
@ -318,7 +318,8 @@ def test_handler_google_actions(hass):
|
|||||||
'entity_config': {
|
'entity_config': {
|
||||||
'switch.test': {
|
'switch.test': {
|
||||||
'name': 'Config name',
|
'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']['name'] == 'Config name'
|
||||||
assert device['name']['nicknames'] == ['Config alias']
|
assert device['name']['nicknames'] == ['Config alias']
|
||||||
assert device['type'] == 'action.devices.types.SWITCH'
|
assert device['type'] == 'action.devices.types.SWITCH'
|
||||||
|
assert device['roomHint'] == 'living room'
|
||||||
|
|
||||||
|
|
||||||
async def test_refresh_token_expired(hass):
|
async def test_refresh_token_expired(hass):
|
||||||
|
Loading…
x
Reference in New Issue
Block a user