Home Assistant Unofficial Reference 2024.12.1
homeassistant.helpers.intent.IntentResponse Class Reference

Public Member Functions

None __init__ (self, str language, Intent|None intent=None)
 
dict[str, Any] as_dict (self)
 
None async_set_card (self, str title, str content, str card_type="simple")
 
None async_set_error (self, IntentResponseErrorCode code, str message)
 
None async_set_reprompt (self, str speech, str speech_type="plain", Any|None extra_data=None)
 
None async_set_results (self, list[IntentResponseTarget] success_results, list[IntentResponseTarget]|None failed_results=None)
 
None async_set_speech (self, str speech, str speech_type="plain", Any|None extra_data=None)
 
None async_set_speech_slots (self, dict[str, Any] speech_slots)
 
None async_set_states (self, list[State] matched_states, list[State]|None unmatched_states=None)
 
None async_set_targets (self, list[IntentResponseTarget] intent_targets)
 

Public Attributes

 error_code
 
 failed_results
 
 intent
 
 intent_targets
 
 language
 
 matched_states
 
 response_type
 
 speech_slots
 
 success_results
 
 unmatched_states
 

Detailed Description

Response to an intent.

Definition at line 1303 of file intent.py.

Constructor & Destructor Documentation

◆ __init__()

None homeassistant.helpers.intent.IntentResponse.__init__ (   self,
str  language,
Intent | None   intent = None 
)
Initialize an IntentResponse.

Definition at line 1306 of file intent.py.

Member Function Documentation

◆ as_dict()

dict[str, Any] homeassistant.helpers.intent.IntentResponse.as_dict (   self)
Return a dictionary representation of an intent response.

Definition at line 1405 of file intent.py.

◆ async_set_card()

None homeassistant.helpers.intent.IntentResponse.async_set_card (   self,
str  title,
str  content,
str   card_type = "simple" 
)
Set card response.

Definition at line 1358 of file intent.py.

◆ async_set_error()

None homeassistant.helpers.intent.IntentResponse.async_set_error (   self,
IntentResponseErrorCode  code,
str  message 
)
Set response error.

Definition at line 1365 of file intent.py.

◆ async_set_reprompt()

None homeassistant.helpers.intent.IntentResponse.async_set_reprompt (   self,
str  speech,
str   speech_type = "plain",
Any | None   extra_data = None 
)
Set reprompt response.

Definition at line 1345 of file intent.py.

◆ async_set_results()

None homeassistant.helpers.intent.IntentResponse.async_set_results (   self,
list[IntentResponseTarget success_results,
list[IntentResponseTarget] | None   failed_results = None 
)
Set response results.

Definition at line 1382 of file intent.py.

◆ async_set_speech()

None homeassistant.helpers.intent.IntentResponse.async_set_speech (   self,
str  speech,
str   speech_type = "plain",
Any | None   extra_data = None 
)
Set speech response.

Definition at line 1332 of file intent.py.

◆ async_set_speech_slots()

None homeassistant.helpers.intent.IntentResponse.async_set_speech_slots (   self,
dict[str, Any]  speech_slots 
)
Set slots that will be used in the response template of the default agent.

Definition at line 1400 of file intent.py.

◆ async_set_states()

None homeassistant.helpers.intent.IntentResponse.async_set_states (   self,
list[State matched_states,
list[State] | None   unmatched_states = None 
)
Set entity states that were matched or not matched during intent handling (query).

Definition at line 1392 of file intent.py.

◆ async_set_targets()

None homeassistant.helpers.intent.IntentResponse.async_set_targets (   self,
list[IntentResponseTarget intent_targets 
)
Set response targets.

Definition at line 1374 of file intent.py.

Member Data Documentation

◆ error_code

homeassistant.helpers.intent.IntentResponse.error_code

Definition at line 1368 of file intent.py.

◆ failed_results

homeassistant.helpers.intent.IntentResponse.failed_results

Definition at line 1389 of file intent.py.

◆ intent

homeassistant.helpers.intent.IntentResponse.intent

Definition at line 1313 of file intent.py.

◆ intent_targets

homeassistant.helpers.intent.IntentResponse.intent_targets

Definition at line 1379 of file intent.py.

◆ language

homeassistant.helpers.intent.IntentResponse.language

Definition at line 1312 of file intent.py.

◆ matched_states

homeassistant.helpers.intent.IntentResponse.matched_states

Definition at line 1396 of file intent.py.

◆ response_type

homeassistant.helpers.intent.IntentResponse.response_type

Definition at line 1327 of file intent.py.

◆ speech_slots

homeassistant.helpers.intent.IntentResponse.speech_slots

Definition at line 1402 of file intent.py.

◆ success_results

homeassistant.helpers.intent.IntentResponse.success_results

Definition at line 1388 of file intent.py.

◆ unmatched_states

homeassistant.helpers.intent.IntentResponse.unmatched_states

Definition at line 1397 of file intent.py.


The documentation for this class was generated from the following file: