mirror of
https://github.com/home-assistant/core.git
synced 2026-08-06 13:26:29 +01:00
Bump intents and add test (#177662)
This commit is contained in:
@@ -6,5 +6,5 @@
|
||||
"documentation": "https://www.home-assistant.io/integrations/conversation",
|
||||
"integration_type": "entity",
|
||||
"quality_scale": "internal",
|
||||
"requirements": ["hassil==3.10.0", "home-assistant-intents==2026.6.24"]
|
||||
"requirements": ["hassil==3.10.0", "home-assistant-intents==2026.7.30"]
|
||||
}
|
||||
|
||||
@@ -40,7 +40,7 @@ hass-nabucasa==2.2.0
|
||||
hassil==3.10.0
|
||||
home-assistant-bluetooth==2.0.0
|
||||
home-assistant-frontend==20260729.1
|
||||
home-assistant-intents==2026.6.24
|
||||
home-assistant-intents==2026.7.30
|
||||
httpx==0.28.1
|
||||
ifaddr==0.2.0
|
||||
Jinja2==3.1.6
|
||||
|
||||
Generated
+1
-1
@@ -27,7 +27,7 @@ ha-ffmpeg==3.2.2
|
||||
hass-nabucasa==2.2.0
|
||||
hassil==3.10.0
|
||||
home-assistant-bluetooth==2.0.0
|
||||
home-assistant-intents==2026.6.24
|
||||
home-assistant-intents==2026.7.30
|
||||
httpx==0.28.1
|
||||
ifaddr==0.2.0
|
||||
infrared-protocols==8.2.1
|
||||
|
||||
Generated
+1
-1
@@ -1281,7 +1281,7 @@ holidays==0.101
|
||||
home-assistant-frontend==20260729.1
|
||||
|
||||
# homeassistant.components.conversation
|
||||
home-assistant-intents==2026.6.24
|
||||
home-assistant-intents==2026.7.30
|
||||
|
||||
# homeassistant.components.homekit
|
||||
homekit-audio-proxy==1.2.1
|
||||
|
||||
@@ -6,6 +6,7 @@
|
||||
'id': 'conversation.home_assistant',
|
||||
'name': 'Home Assistant',
|
||||
'supported_languages': list([
|
||||
'af',
|
||||
'ar',
|
||||
'bg',
|
||||
'bn',
|
||||
@@ -24,6 +25,7 @@
|
||||
'fi',
|
||||
'fr',
|
||||
'gl',
|
||||
'gu',
|
||||
'he',
|
||||
'hi',
|
||||
'hr',
|
||||
@@ -34,6 +36,7 @@
|
||||
'it',
|
||||
'ja',
|
||||
'ka',
|
||||
'kn',
|
||||
'ko',
|
||||
'kw',
|
||||
'lb',
|
||||
|
||||
@@ -6,6 +6,7 @@ from unittest.mock import patch
|
||||
import pytest
|
||||
|
||||
from homeassistant.components import (
|
||||
climate,
|
||||
conversation,
|
||||
cover,
|
||||
light,
|
||||
@@ -25,6 +26,8 @@ from homeassistant.components.vacuum import intent as vaccum_intent
|
||||
from homeassistant.const import (
|
||||
ATTR_SUPPORTED_FEATURES,
|
||||
STATE_CLOSED,
|
||||
STATE_OFF,
|
||||
STATE_ON,
|
||||
STATE_PAUSED,
|
||||
STATE_PLAYING,
|
||||
)
|
||||
@@ -463,6 +466,49 @@ async def test_todo_add_item_fr(
|
||||
assert intent_obj.slots.get("item", {}).get("value", "").strip() == "farine"
|
||||
|
||||
|
||||
async def test_climate_turn_on_off(
|
||||
hass: HomeAssistant,
|
||||
init_components,
|
||||
) -> None:
|
||||
"""Test turning a climate device on and off."""
|
||||
entity_id = f"{climate.DOMAIN}.thermostat"
|
||||
attributes = {
|
||||
ATTR_SUPPORTED_FEATURES: climate.ClimateEntityFeature.TURN_ON
|
||||
| climate.ClimateEntityFeature.TURN_OFF
|
||||
}
|
||||
|
||||
hass.states.async_set(entity_id, STATE_OFF, attributes=attributes)
|
||||
async_expose_entity(hass, conversation.DOMAIN, entity_id, True)
|
||||
|
||||
# turn on
|
||||
on_calls = async_mock_service(hass, climate.DOMAIN, climate.SERVICE_TURN_ON)
|
||||
result = await conversation.async_converse(
|
||||
hass, "turn on the thermostat", None, Context(), None
|
||||
)
|
||||
await hass.async_block_till_done()
|
||||
|
||||
response = result.response
|
||||
assert response.response_type is intent.IntentResponseType.ACTION_DONE
|
||||
assert len(on_calls) == 1
|
||||
call = on_calls[0]
|
||||
assert call.data == {"entity_id": [entity_id]}
|
||||
|
||||
hass.states.async_set(entity_id, STATE_ON, attributes=attributes)
|
||||
|
||||
# turn off
|
||||
off_calls = async_mock_service(hass, climate.DOMAIN, climate.SERVICE_TURN_OFF)
|
||||
result = await conversation.async_converse(
|
||||
hass, "turn off the thermostat", None, Context(), None
|
||||
)
|
||||
await hass.async_block_till_done()
|
||||
|
||||
response = result.response
|
||||
assert response.response_type is intent.IntentResponseType.ACTION_DONE
|
||||
assert len(off_calls) == 1
|
||||
call = off_calls[0]
|
||||
assert call.data == {"entity_id": [entity_id]}
|
||||
|
||||
|
||||
@pytest.mark.freeze_time(
|
||||
datetime(
|
||||
year=2013,
|
||||
|
||||
Reference in New Issue
Block a user