mirror of
https://github.com/home-assistant/core.git
synced 2025-07-19 11:17:21 +00:00
Enable Alexa state reporting by default (#63802)
This commit is contained in:
parent
737ac7cb7c
commit
9718fd2534
@ -23,7 +23,7 @@ PREF_GOOGLE_DEFAULT_EXPOSE = "google_default_expose"
|
||||
PREF_TTS_DEFAULT_VOICE = "tts_default_voice"
|
||||
DEFAULT_TTS_DEFAULT_VOICE = ("en-US", "female")
|
||||
DEFAULT_DISABLE_2FA = False
|
||||
DEFAULT_ALEXA_REPORT_STATE = False
|
||||
DEFAULT_ALEXA_REPORT_STATE = True
|
||||
DEFAULT_GOOGLE_REPORT_STATE = True
|
||||
DEFAULT_EXPOSED_DOMAINS = [
|
||||
"climate",
|
||||
|
@ -50,6 +50,7 @@ async def test_alexa_config_expose_entity_prefs(hass, cloud_prefs, cloud_stub):
|
||||
alexa_entity_configs={"light.kitchen": entity_conf},
|
||||
alexa_default_expose=["light"],
|
||||
alexa_enabled=True,
|
||||
alexa_report_state=False,
|
||||
)
|
||||
conf = alexa_config.CloudAlexaConfig(
|
||||
hass, ALEXA_SCHEMA({}), "mock-user-id", cloud_prefs, cloud_stub
|
||||
@ -86,6 +87,9 @@ async def test_alexa_config_expose_entity_prefs(hass, cloud_prefs, cloud_stub):
|
||||
|
||||
async def test_alexa_config_report_state(hass, cloud_prefs, cloud_stub):
|
||||
"""Test Alexa config should expose using prefs."""
|
||||
await cloud_prefs.async_update(
|
||||
alexa_report_state=False,
|
||||
)
|
||||
conf = alexa_config.CloudAlexaConfig(
|
||||
hass, ALEXA_SCHEMA({}), "mock-user-id", cloud_prefs, cloud_stub
|
||||
)
|
||||
@ -175,6 +179,9 @@ async def test_alexa_config_fail_refresh_token(
|
||||
},
|
||||
)
|
||||
aioclient_mock.post("http://example.com/alexa_endpoint", text="", status=202)
|
||||
await cloud_prefs.async_update(
|
||||
alexa_report_state=False,
|
||||
)
|
||||
conf = alexa_config.CloudAlexaConfig(
|
||||
hass,
|
||||
ALEXA_SCHEMA({}),
|
||||
@ -273,6 +280,9 @@ def patch_sync_helper():
|
||||
|
||||
async def test_alexa_update_expose_trigger_sync(hass, cloud_prefs, cloud_stub):
|
||||
"""Test Alexa config responds to updating exposed entities."""
|
||||
await cloud_prefs.async_update(
|
||||
alexa_report_state=False,
|
||||
)
|
||||
await alexa_config.CloudAlexaConfig(
|
||||
hass, ALEXA_SCHEMA({}), "mock-user-id", cloud_prefs, cloud_stub
|
||||
).async_initialize()
|
||||
@ -360,6 +370,9 @@ async def test_alexa_entity_registry_sync(hass, mock_cloud_login, cloud_prefs):
|
||||
|
||||
async def test_alexa_update_report_state(hass, cloud_prefs, cloud_stub):
|
||||
"""Test Alexa config responds to reporting state."""
|
||||
await cloud_prefs.async_update(
|
||||
alexa_report_state=False,
|
||||
)
|
||||
conf = alexa_config.CloudAlexaConfig(
|
||||
hass, ALEXA_SCHEMA({}), "mock-user-id", cloud_prefs, cloud_stub
|
||||
)
|
||||
|
@ -8,7 +8,11 @@ import pytest
|
||||
|
||||
from homeassistant.components.cloud import DOMAIN
|
||||
from homeassistant.components.cloud.client import CloudClient
|
||||
from homeassistant.components.cloud.const import PREF_ENABLE_ALEXA, PREF_ENABLE_GOOGLE
|
||||
from homeassistant.components.cloud.const import (
|
||||
PREF_ALEXA_REPORT_STATE,
|
||||
PREF_ENABLE_ALEXA,
|
||||
PREF_ENABLE_GOOGLE,
|
||||
)
|
||||
from homeassistant.const import CONTENT_TYPE_JSON
|
||||
from homeassistant.core import State
|
||||
from homeassistant.setup import async_setup_component
|
||||
@ -47,7 +51,7 @@ async def test_handler_alexa(hass):
|
||||
},
|
||||
)
|
||||
|
||||
mock_cloud_prefs(hass)
|
||||
mock_cloud_prefs(hass, {PREF_ALEXA_REPORT_STATE: False})
|
||||
cloud = hass.data["cloud"]
|
||||
|
||||
resp = await cloud.client.async_alexa_message(
|
||||
|
@ -401,7 +401,7 @@ async def test_websocket_status(
|
||||
"google_default_expose": None,
|
||||
"alexa_default_expose": None,
|
||||
"alexa_entity_configs": {},
|
||||
"alexa_report_state": False,
|
||||
"alexa_report_state": True,
|
||||
"google_report_state": True,
|
||||
"remote_enabled": False,
|
||||
"tts_default_voice": ["en-US", "female"],
|
||||
|
Loading…
x
Reference in New Issue
Block a user