From df3d4b5db14aba1d8c03e4ed304e3f88383c30ca Mon Sep 17 00:00:00 2001 From: Artur Pragacz <49985303+arturpragacz@users.noreply.github.com> Date: Mon, 8 Sep 2025 19:42:23 +0200 Subject: [PATCH] Clean up unused intent category (#151917) --- .../components/assist_satellite/intent.py | 1 - homeassistant/components/climate/intent.py | 1 - .../components/conversation/default_agent.py | 1 - .../components/media_player/intent.py | 2 -- .../components/shopping_list/intent.py | 1 - homeassistant/components/todo/intent.py | 2 -- homeassistant/helpers/intent.py | 20 +------------------ 7 files changed, 1 insertion(+), 27 deletions(-) diff --git a/homeassistant/components/assist_satellite/intent.py b/homeassistant/components/assist_satellite/intent.py index 7612753e8c4..24958b36153 100644 --- a/homeassistant/components/assist_satellite/intent.py +++ b/homeassistant/components/assist_satellite/intent.py @@ -75,7 +75,6 @@ class BroadcastIntentHandler(intent.IntentHandler): ) response = intent_obj.create_response() - response.response_type = intent.IntentResponseType.ACTION_DONE response.async_set_results( success_results=[ intent.IntentResponseTarget( diff --git a/homeassistant/components/climate/intent.py b/homeassistant/components/climate/intent.py index 7691a2db0f1..6f820ce0837 100644 --- a/homeassistant/components/climate/intent.py +++ b/homeassistant/components/climate/intent.py @@ -89,7 +89,6 @@ class SetTemperatureIntent(intent.IntentHandler): ) response = intent_obj.create_response() - response.response_type = intent.IntentResponseType.ACTION_DONE response.async_set_results( success_results=[ intent.IntentResponseTarget( diff --git a/homeassistant/components/conversation/default_agent.py b/homeassistant/components/conversation/default_agent.py index 938889955e9..4e07fd0135f 100644 --- a/homeassistant/components/conversation/default_agent.py +++ b/homeassistant/components/conversation/default_agent.py @@ -371,7 +371,6 @@ class DefaultAgent(ConversationEntity): response = intent.IntentResponse( language=user_input.language or self.hass.config.language ) - response.response_type = intent.IntentResponseType.ACTION_DONE response.async_set_speech(response_text) if response is None: diff --git a/homeassistant/components/media_player/intent.py b/homeassistant/components/media_player/intent.py index 9b714fdf52d..c45dc83e872 100644 --- a/homeassistant/components/media_player/intent.py +++ b/homeassistant/components/media_player/intent.py @@ -355,7 +355,6 @@ class MediaSearchAndPlayHandler(intent.IntentHandler): # Success response = intent_obj.create_response() response.async_set_speech_slots({"media": first_result.as_dict()}) - response.response_type = intent.IntentResponseType.ACTION_DONE return response @@ -471,6 +470,5 @@ class MediaSetVolumeRelativeHandler(intent.IntentHandler): ) from err response = intent_obj.create_response() - response.response_type = intent.IntentResponseType.ACTION_DONE response.async_set_states(match_result.states) return response diff --git a/homeassistant/components/shopping_list/intent.py b/homeassistant/components/shopping_list/intent.py index 29e366fc5dd..06bb692621a 100644 --- a/homeassistant/components/shopping_list/intent.py +++ b/homeassistant/components/shopping_list/intent.py @@ -60,7 +60,6 @@ class CompleteItemIntent(intent.IntentHandler): response = intent_obj.create_response() response.async_set_speech_slots({"completed_items": complete_items}) - response.response_type = intent.IntentResponseType.ACTION_DONE return response diff --git a/homeassistant/components/todo/intent.py b/homeassistant/components/todo/intent.py index d679a57bf96..a1379b003f6 100644 --- a/homeassistant/components/todo/intent.py +++ b/homeassistant/components/todo/intent.py @@ -65,7 +65,6 @@ class ListAddItemIntent(intent.IntentHandler): ) response: intent.IntentResponse = intent_obj.create_response() - response.response_type = intent.IntentResponseType.ACTION_DONE response.async_set_results( [ intent.IntentResponseTarget( @@ -141,7 +140,6 @@ class ListCompleteItemIntent(intent.IntentHandler): ) response: intent.IntentResponse = intent_obj.create_response() - response.response_type = intent.IntentResponseType.ACTION_DONE response.async_set_results( [ intent.IntentResponseTarget( diff --git a/homeassistant/helpers/intent.py b/homeassistant/helpers/intent.py index 75572194bb8..de6f98527c5 100644 --- a/homeassistant/helpers/intent.py +++ b/homeassistant/helpers/intent.py @@ -1264,22 +1264,11 @@ class ServiceIntentHandler(DynamicServiceIntentHandler): return (self.domain, self.service) -class IntentCategory(Enum): - """Category of an intent.""" - - ACTION = "action" - """Trigger an action like turning an entity on or off""" - - QUERY = "query" - """Get information about the state of an entity""" - - class Intent: """Hold the intent.""" __slots__ = [ "assistant", - "category", "context", "conversation_agent_id", "device_id", @@ -1300,7 +1289,6 @@ class Intent: text_input: str | None, context: Context, language: str, - category: IntentCategory | None = None, assistant: str | None = None, device_id: str | None = None, conversation_agent_id: str | None = None, @@ -1313,7 +1301,6 @@ class Intent: self.text_input = text_input self.context = context self.language = language - self.category = category self.assistant = assistant self.device_id = device_id self.conversation_agent_id = conversation_agent_id @@ -1398,12 +1385,7 @@ class IntentResponse: self.matched_states: list[State] = [] self.unmatched_states: list[State] = [] self.speech_slots: dict[str, Any] = {} - - if (self.intent is not None) and (self.intent.category == IntentCategory.QUERY): - # speech will be the answer to the query - self.response_type = IntentResponseType.QUERY_ANSWER - else: - self.response_type = IntentResponseType.ACTION_DONE + self.response_type = IntentResponseType.ACTION_DONE @callback def async_set_speech(