Skip to content

Commit ad4fae7

Browse files
authored
Custom sentence triggers should be marked as processed locally (#145704)
* Mark custom sentence triggers a local agent * Don't change agent ID * adds tests to confirm processed_locally is True * move asserts to after null check
1 parent 265de91 commit ad4fae7

2 files changed

Lines changed: 3 additions & 0 deletions

File tree

homeassistant/components/assist_pipeline/pipeline.py

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1119,6 +1119,7 @@ async def recognize_intent(
11191119
) is not None:
11201120
# Sentence trigger matched
11211121
agent_id = "sentence_trigger"
1122+
processed_locally = True
11221123
intent_response = intent.IntentResponse(
11231124
self.pipeline.conversation_language
11241125
)

tests/components/assist_pipeline/test_pipeline.py

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1110,6 +1110,7 @@ async def test_sentence_trigger_overrides_conversation_agent(
11101110
None,
11111111
)
11121112
assert (intent_end_event is not None) and intent_end_event.data
1113+
assert intent_end_event.data["processed_locally"] is True
11131114
assert (
11141115
intent_end_event.data["intent_output"]["response"]["speech"]["plain"][
11151116
"speech"
@@ -1192,6 +1193,7 @@ async def async_handle(
11921193
None,
11931194
)
11941195
assert (intent_end_event is not None) and intent_end_event.data
1196+
assert intent_end_event.data["processed_locally"] is True
11951197
assert (
11961198
intent_end_event.data["intent_output"]["response"]["speech"]["plain"][
11971199
"speech"

0 commit comments

Comments
 (0)