1
0
mirror of https://github.com/home-assistant/core.git synced 2025-12-24 21:06:19 +00:00

Allow exposing domains in cloud (#39216)

This commit is contained in:
Paulus Schoutsen
2020-08-28 16:49:17 +02:00
committed by GitHub
parent 414a59ae9f
commit 5217139e0b
8 changed files with 193 additions and 43 deletions

View File

@@ -12,13 +12,22 @@ from tests.common import async_fire_time_changed
async def test_alexa_config_expose_entity_prefs(hass, cloud_prefs):
"""Test Alexa config should expose using prefs."""
entity_conf = {"should_expose": False}
await cloud_prefs.async_update(alexa_entity_configs={"light.kitchen": entity_conf})
await cloud_prefs.async_update(
alexa_entity_configs={"light.kitchen": entity_conf},
alexa_default_expose=["light"],
)
conf = alexa_config.AlexaConfig(hass, ALEXA_SCHEMA({}), cloud_prefs, None)
assert not conf.should_expose("light.kitchen")
entity_conf["should_expose"] = True
assert conf.should_expose("light.kitchen")
entity_conf["should_expose"] = None
assert conf.should_expose("light.kitchen")
await cloud_prefs.async_update(alexa_default_expose=["sensor"],)
assert not conf.should_expose("light.kitchen")
async def test_alexa_config_report_state(hass, cloud_prefs):
"""Test Alexa config should expose using prefs."""