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

Only expose default cloud domains in Assist default agent (#88274)

* Only expose default cloud domains in default agent

* Copy exposed domain list to conversation

* Implement requested changes

* Add test for exposed devices/areas
This commit is contained in:
Michael Hansen
2023-02-17 15:19:22 -06:00
committed by GitHub
parent 331102e592
commit 325674ec44
4 changed files with 157 additions and 41 deletions

View File

@@ -158,14 +158,19 @@ def test_async_validate_slots() -> None:
)
async def test_cant_turn_on_sun(hass: HomeAssistant) -> None:
"""Test we can't turn on entities that don't support it."""
async def test_cant_turn_on_sensor(hass: HomeAssistant) -> None:
"""Test that we can't turn on entities that don't support it."""
assert await async_setup_component(hass, "homeassistant", {})
assert await async_setup_component(hass, "conversation", {})
assert await async_setup_component(hass, "intent", {})
assert await async_setup_component(hass, "sun", {})
assert await async_setup_component(hass, "sensor", {})
hass.states.async_set(
"sensor.test", "123", attributes={ATTR_FRIENDLY_NAME: "Test Sensor"}
)
result = await conversation.async_converse(
hass, "turn on sun", None, Context(), None
hass, "turn on test sensor", None, Context(), None
)
assert result.response.response_type == intent.IntentResponseType.ERROR