mirror of
https://github.com/home-assistant/core.git
synced 2025-04-25 09:47:52 +00:00
Add HassNevermind intent (bump intents package) (#102131)
* Add HassNevermind intent * Bump intents package to 2023.10.16
This commit is contained in:
parent
6d457e808f
commit
25671a2e42
@ -7,5 +7,5 @@
|
|||||||
"integration_type": "system",
|
"integration_type": "system",
|
||||||
"iot_class": "local_push",
|
"iot_class": "local_push",
|
||||||
"quality_scale": "internal",
|
"quality_scale": "internal",
|
||||||
"requirements": ["hassil==1.2.5", "home-assistant-intents==2023.10.2"]
|
"requirements": ["hassil==1.2.5", "home-assistant-intents==2023.10.16"]
|
||||||
}
|
}
|
||||||
|
@ -56,6 +56,10 @@ async def async_setup(hass: HomeAssistant, config: ConfigType) -> bool:
|
|||||||
hass,
|
hass,
|
||||||
GetStateIntentHandler(),
|
GetStateIntentHandler(),
|
||||||
)
|
)
|
||||||
|
intent.async_register(
|
||||||
|
hass,
|
||||||
|
NevermindIntentHandler(),
|
||||||
|
)
|
||||||
|
|
||||||
return True
|
return True
|
||||||
|
|
||||||
@ -206,6 +210,16 @@ class GetStateIntentHandler(intent.IntentHandler):
|
|||||||
return response
|
return response
|
||||||
|
|
||||||
|
|
||||||
|
class NevermindIntentHandler(intent.IntentHandler):
|
||||||
|
"""Takes no action."""
|
||||||
|
|
||||||
|
intent_type = intent.INTENT_NEVERMIND
|
||||||
|
|
||||||
|
async def async_handle(self, intent_obj: intent.Intent) -> intent.IntentResponse:
|
||||||
|
"""Doe not do anything, and produces an empty response."""
|
||||||
|
return intent_obj.create_response()
|
||||||
|
|
||||||
|
|
||||||
async def _async_process_intent(hass: HomeAssistant, domain: str, platform):
|
async def _async_process_intent(hass: HomeAssistant, domain: str, platform):
|
||||||
"""Process the intents of an integration."""
|
"""Process the intents of an integration."""
|
||||||
await platform.async_setup_intents(hass)
|
await platform.async_setup_intents(hass)
|
||||||
|
@ -31,6 +31,7 @@ INTENT_TURN_OFF = "HassTurnOff"
|
|||||||
INTENT_TURN_ON = "HassTurnOn"
|
INTENT_TURN_ON = "HassTurnOn"
|
||||||
INTENT_TOGGLE = "HassToggle"
|
INTENT_TOGGLE = "HassToggle"
|
||||||
INTENT_GET_STATE = "HassGetState"
|
INTENT_GET_STATE = "HassGetState"
|
||||||
|
INTENT_NEVERMIND = "HassNevermind"
|
||||||
|
|
||||||
SLOT_SCHEMA = vol.Schema({}, extra=vol.ALLOW_EXTRA)
|
SLOT_SCHEMA = vol.Schema({}, extra=vol.ALLOW_EXTRA)
|
||||||
|
|
||||||
|
@ -23,7 +23,7 @@ hass-nabucasa==0.73.0
|
|||||||
hassil==1.2.5
|
hassil==1.2.5
|
||||||
home-assistant-bluetooth==1.10.3
|
home-assistant-bluetooth==1.10.3
|
||||||
home-assistant-frontend==20231005.0
|
home-assistant-frontend==20231005.0
|
||||||
home-assistant-intents==2023.10.2
|
home-assistant-intents==2023.10.16
|
||||||
httpx==0.25.0
|
httpx==0.25.0
|
||||||
ifaddr==0.2.0
|
ifaddr==0.2.0
|
||||||
janus==1.0.0
|
janus==1.0.0
|
||||||
|
@ -1009,7 +1009,7 @@ holidays==0.28
|
|||||||
home-assistant-frontend==20231005.0
|
home-assistant-frontend==20231005.0
|
||||||
|
|
||||||
# homeassistant.components.conversation
|
# homeassistant.components.conversation
|
||||||
home-assistant-intents==2023.10.2
|
home-assistant-intents==2023.10.16
|
||||||
|
|
||||||
# homeassistant.components.home_connect
|
# homeassistant.components.home_connect
|
||||||
homeconnect==0.7.2
|
homeconnect==0.7.2
|
||||||
|
@ -798,7 +798,7 @@ holidays==0.28
|
|||||||
home-assistant-frontend==20231005.0
|
home-assistant-frontend==20231005.0
|
||||||
|
|
||||||
# homeassistant.components.conversation
|
# homeassistant.components.conversation
|
||||||
home-assistant-intents==2023.10.2
|
home-assistant-intents==2023.10.16
|
||||||
|
|
||||||
# homeassistant.components.home_connect
|
# homeassistant.components.home_connect
|
||||||
homeconnect==0.7.2
|
homeconnect==0.7.2
|
||||||
|
@ -283,3 +283,13 @@ async def test_shopping_list_add_item(
|
|||||||
assert result.response.speech == {
|
assert result.response.speech == {
|
||||||
"plain": {"speech": "Added apples", "extra_data": None}
|
"plain": {"speech": "Added apples", "extra_data": None}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
|
async def test_nevermind_item(hass: HomeAssistant, init_components) -> None:
|
||||||
|
"""Test HassNevermind intent through the default agent."""
|
||||||
|
result = await conversation.async_converse(hass, "nevermind", None, Context())
|
||||||
|
assert result.response.intent is not None
|
||||||
|
assert result.response.intent.intent_type == intent.INTENT_NEVERMIND
|
||||||
|
|
||||||
|
assert result.response.response_type == intent.IntentResponseType.ACTION_DONE
|
||||||
|
assert not result.response.speech
|
||||||
|
Loading…
x
Reference in New Issue
Block a user