mirror of
https://github.com/home-assistant/core.git
synced 2025-12-24 21:06:19 +00:00
Pass device_id to intent handlers (#117442)
This commit is contained in:
@@ -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:
|
||||
|
||||
Reference in New Issue
Block a user