Pass device_id to intent handlers (#117442)
This commit is contained in:
parent
d88851a85a
commit
641754e0bb
3 changed files with 38 additions and 0 deletions
|
@ -97,6 +97,7 @@ async def async_handle(
|
|||
context: Context | None = None,
|
||||
language: str | None = None,
|
||||
assistant: str | None = None,
|
||||
device_id: str | None = None,
|
||||
) -> IntentResponse:
|
||||
"""Handle an intent."""
|
||||
handler = hass.data.get(DATA_KEY, {}).get(intent_type)
|
||||
|
@ -119,6 +120,7 @@ async def async_handle(
|
|||
context=context,
|
||||
language=language,
|
||||
assistant=assistant,
|
||||
device_id=device_id,
|
||||
)
|
||||
|
||||
try:
|
||||
|
@ -1116,6 +1118,7 @@ class Intent:
|
|||
"language",
|
||||
"category",
|
||||
"assistant",
|
||||
"device_id",
|
||||
]
|
||||
|
||||
def __init__(
|
||||
|
@ -1129,6 +1132,7 @@ class Intent:
|
|||
language: str,
|
||||
category: IntentCategory | None = None,
|
||||
assistant: str | None = None,
|
||||
device_id: str | None = None,
|
||||
) -> None:
|
||||
"""Initialize an intent."""
|
||||
self.hass = hass
|
||||
|
@ -1140,6 +1144,7 @@ class Intent:
|
|||
self.language = language
|
||||
self.category = category
|
||||
self.assistant = assistant
|
||||
self.device_id = device_id
|
||||
|
||||
@callback
|
||||
def create_response(self) -> IntentResponse:
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue