Home Assistant Unofficial Reference 2024.12.1
homeassistant.helpers.intent.DynamicServiceIntentHandler Class Reference
Inheritance diagram for homeassistant.helpers.intent.DynamicServiceIntentHandler:
[legend]
Collaboration diagram for homeassistant.helpers.intent.DynamicServiceIntentHandler:
[legend]

Public Member Functions

None __init__ (self, str intent_type, str|None speech=None, _IntentSlotsType|None required_slots=None, _IntentSlotsType|None optional_slots=None, set[str]|None required_domains=None, int|None required_features=None, set[str]|None required_states=None, str|None description=None, set[str]|None platforms=None, set[type[StrEnum]]|None device_classes=None)
 
None async_call_service (self, str domain, str service, Intent intent_obj, State state)
 
IntentResponse async_handle (self, Intent intent_obj)
 
IntentResponse async_handle_states (self, Intent intent_obj, MatchTargetsResult match_result, MatchTargetsConstraints match_constraints, MatchTargetsPreferences|None match_preferences=None)
 
tuple[str, str] get_domain_and_service (self, Intent intent_obj, State state)
 
dict slot_schema (self)
 
- Public Member Functions inherited from homeassistant.helpers.intent.IntentHandler
str __repr__ (self)
 
bool async_can_handle (self, Intent intent_obj)
 
_SlotsType async_validate_slots (self, _SlotsType slots)
 

Public Attributes

 description
 
 device_classes
 
 intent_type
 
 platforms
 
 required_domains
 
 required_features
 
 required_states
 
 speech
 

Static Public Attributes

 float
 
- Static Public Attributes inherited from homeassistant.helpers.intent.IntentHandler
 None
 

Private Member Functions

None _run_then_background (self, asyncio.Task[Any] task)
 

Detailed Description

Service Intent handler registration (dynamic).

Service specific intent handler that calls a service by name/entity_id.

Definition at line 820 of file intent.py.

Constructor & Destructor Documentation

◆ __init__()

None homeassistant.helpers.intent.DynamicServiceIntentHandler.__init__ (   self,
str  intent_type,
str | None   speech = None,
_IntentSlotsType | None   required_slots = None,
_IntentSlotsType | None   optional_slots = None,
set[str] | None   required_domains = None,
int | None   required_features = None,
set[str] | None   required_states = None,
str | None   description = None,
set[str] | None   platforms = None,
set[type[StrEnum]] | None   device_classes = None 
)
Create Service Intent Handler.

Definition at line 830 of file intent.py.

Member Function Documentation

◆ _run_then_background()

None homeassistant.helpers.intent.DynamicServiceIntentHandler._run_then_background (   self,
asyncio.Task[Any]  task 
)
private
Run task with timeout to (hopefully) catch validation errors.

After the timeout the task will continue to run in the background.

Definition at line 1128 of file intent.py.

◆ async_call_service()

None homeassistant.helpers.intent.DynamicServiceIntentHandler.async_call_service (   self,
str  domain,
str  service,
Intent  intent_obj,
State   state 
)
Call service on entity.

Definition at line 1094 of file intent.py.

◆ async_handle()

IntentResponse homeassistant.helpers.intent.DynamicServiceIntentHandler.async_handle (   self,
Intent  intent_obj 
)
Handle the hass intent.

Reimplemented from homeassistant.helpers.intent.IntentHandler.

Definition at line 932 of file intent.py.

◆ async_handle_states()

IntentResponse homeassistant.helpers.intent.DynamicServiceIntentHandler.async_handle_states (   self,
Intent  intent_obj,
MatchTargetsResult  match_result,
MatchTargetsConstraints  match_constraints,
MatchTargetsPreferences | None   match_preferences = None 
)
Complete action on matched entity states.

Definition at line 1014 of file intent.py.

◆ get_domain_and_service()

tuple[str, str] homeassistant.helpers.intent.DynamicServiceIntentHandler.get_domain_and_service (   self,
Intent  intent_obj,
State   state 
)
Get the domain and service name to call.

Reimplemented in homeassistant.helpers.intent.ServiceIntentHandler.

Definition at line 926 of file intent.py.

◆ slot_schema()

dict homeassistant.helpers.intent.DynamicServiceIntentHandler.slot_schema (   self)
Return a slot schema.

Reimplemented from homeassistant.helpers.intent.IntentHandler.

Definition at line 872 of file intent.py.

Member Data Documentation

◆ description

homeassistant.helpers.intent.DynamicServiceIntentHandler.description

Definition at line 849 of file intent.py.

◆ device_classes

homeassistant.helpers.intent.DynamicServiceIntentHandler.device_classes

Definition at line 851 of file intent.py.

◆ float

homeassistant.helpers.intent.DynamicServiceIntentHandler.float
static

Definition at line 828 of file intent.py.

◆ intent_type

homeassistant.helpers.intent.DynamicServiceIntentHandler.intent_type

Definition at line 844 of file intent.py.

◆ platforms

homeassistant.helpers.intent.DynamicServiceIntentHandler.platforms

Definition at line 850 of file intent.py.

◆ required_domains

homeassistant.helpers.intent.DynamicServiceIntentHandler.required_domains

Definition at line 846 of file intent.py.

◆ required_features

homeassistant.helpers.intent.DynamicServiceIntentHandler.required_features

Definition at line 847 of file intent.py.

◆ required_states

homeassistant.helpers.intent.DynamicServiceIntentHandler.required_states

Definition at line 848 of file intent.py.

◆ speech

homeassistant.helpers.intent.DynamicServiceIntentHandler.speech

Definition at line 845 of file intent.py.


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