Add name slot to HassClimateGetTemperature intent (#105585)

This commit is contained in:
Michael Hansen 2023-12-12 21:54:15 -06:00 committed by GitHub
parent 22f0e09b8c
commit 431a44ab67
No known key found for this signature in database
GPG key ID: 4AEE18F83AFDEB23
2 changed files with 29 additions and 2 deletions

View file

@ -153,7 +153,7 @@ async def test_get_temperature(
state = response.matched_states[0]
assert state.attributes["current_temperature"] == 10.0
# Select by area instead (climate_2)
# Select by area (climate_2)
response = await intent.async_handle(
hass,
"test",
@ -166,6 +166,19 @@ async def test_get_temperature(
state = response.matched_states[0]
assert state.attributes["current_temperature"] == 22.0
# Select by name (climate_2)
response = await intent.async_handle(
hass,
"test",
climate_intent.INTENT_GET_TEMPERATURE,
{"name": {"value": "Climate 2"}},
)
assert response.response_type == intent.IntentResponseType.QUERY_ANSWER
assert len(response.matched_states) == 1
assert response.matched_states[0].entity_id == climate_2.entity_id
state = response.matched_states[0]
assert state.attributes["current_temperature"] == 22.0
async def test_get_temperature_no_entities(
hass: HomeAssistant,