Add HassRespond intent (#129755)
* Add HassHello intent * Rename to HassRespond * LLM's ignore HassRespond intentpull/124168/head
parent
8b6c99776e
commit
c2ef119e50
|
@ -137,6 +137,7 @@ async def async_setup(hass: HomeAssistant, config: ConfigType) -> bool:
|
|||
intent.async_register(hass, TimerStatusIntentHandler())
|
||||
intent.async_register(hass, GetCurrentDateIntentHandler())
|
||||
intent.async_register(hass, GetCurrentTimeIntentHandler())
|
||||
intent.async_register(hass, HelloIntentHandler())
|
||||
|
||||
return True
|
||||
|
||||
|
@ -364,7 +365,7 @@ class NevermindIntentHandler(intent.IntentHandler):
|
|||
description = "Cancels the current request and does nothing"
|
||||
|
||||
async def async_handle(self, intent_obj: intent.Intent) -> intent.IntentResponse:
|
||||
"""Doe not do anything, and produces an empty response."""
|
||||
"""Do nothing and produces an empty response."""
|
||||
return intent_obj.create_response()
|
||||
|
||||
|
||||
|
@ -420,6 +421,17 @@ class GetCurrentTimeIntentHandler(intent.IntentHandler):
|
|||
return response
|
||||
|
||||
|
||||
class HelloIntentHandler(intent.IntentHandler):
|
||||
"""Responds with no action."""
|
||||
|
||||
intent_type = intent.INTENT_RESPOND
|
||||
description = "Returns the provided response with no action."
|
||||
|
||||
async def async_handle(self, intent_obj: intent.Intent) -> intent.IntentResponse:
|
||||
"""Return the provided response, but take no action."""
|
||||
return intent_obj.create_response()
|
||||
|
||||
|
||||
async def _async_process_intent(
|
||||
hass: HomeAssistant, domain: str, platform: IntentPlatformProtocol
|
||||
) -> None:
|
||||
|
|
|
@ -56,6 +56,7 @@ INTENT_UNPAUSE_TIMER = "HassUnpauseTimer"
|
|||
INTENT_TIMER_STATUS = "HassTimerStatus"
|
||||
INTENT_GET_CURRENT_DATE = "HassGetCurrentDate"
|
||||
INTENT_GET_CURRENT_TIME = "HassGetCurrentTime"
|
||||
INTENT_RESPOND = "HassRespond"
|
||||
|
||||
SLOT_SCHEMA = vol.Schema({}, extra=vol.ALLOW_EXTRA)
|
||||
|
||||
|
|
|
@ -279,6 +279,7 @@ class AssistAPI(API):
|
|||
intent.INTENT_TOGGLE,
|
||||
intent.INTENT_GET_CURRENT_DATE,
|
||||
intent.INTENT_GET_CURRENT_TIME,
|
||||
intent.INTENT_RESPOND,
|
||||
}
|
||||
|
||||
def __init__(self, hass: HomeAssistant) -> None:
|
||||
|
|
Loading…
Reference in New Issue