diff --git a/custom_components/fallback_conversation/__init__.py b/custom_components/fallback_conversation/__init__.py index 38f703e..a1a627d 100644 --- a/custom_components/fallback_conversation/__init__.py +++ b/custom_components/fallback_conversation/__init__.py @@ -23,6 +23,7 @@ DEBUG_LEVEL_LOW_DEBUG, DEBUG_LEVEL_VERBOSE_DEBUG, DOMAIN, + STRANGE_ERROR_RESPONSES, ) @@ -85,14 +86,14 @@ async def async_process( result = None for agent_id in agents: result = await self._async_process_agent( - agent_manager, - agent_id, - agent_names[agent_id], - user_input, + agent_manager, + agent_id, + agent_names[agent_id] or "[unknown]", + user_input, debug_level, result, ) - if result.response.response_type != intent.IntentResponseType.ERROR: + if result.response.response_type != intent.IntentResponseType.ERROR and result.response.speech['plain']['original_speech'].lower() not in STRANGE_ERROR_RESPONSES: return result all_results.append(result) @@ -113,15 +114,15 @@ async def async_process( conversation_id=result.conversation_id, response=intent_response ) - + return result async def _async_process_agent( - self, - agent_manager: conversation.AgentManager, + self, + agent_manager: conversation.AgentManager, agent_id: str, agent_name: str, - user_input: conversation.ConversationInput, + user_input: conversation.ConversationInput, debug_level: int, previous_result, ) -> conversation.ConversationResult: diff --git a/custom_components/fallback_conversation/const.py b/custom_components/fallback_conversation/const.py index 32a2eaf..df148f3 100644 --- a/custom_components/fallback_conversation/const.py +++ b/custom_components/fallback_conversation/const.py @@ -11,4 +11,9 @@ DEBUG_LEVEL_VERBOSE_DEBUG = "verbose" DEFAULT_NAME = "Fallback Conversation Agent" -DEFAULT_DEBUG_LEVEL = DEBUG_LEVEL_NO_DEBUG \ No newline at end of file +DEFAULT_DEBUG_LEVEL = DEBUG_LEVEL_NO_DEBUG + +STRANGE_ERROR_RESPONSES = [ + "not any", + "geen", +] \ No newline at end of file diff --git a/custom_components/fallback_conversation/manifest.json b/custom_components/fallback_conversation/manifest.json index 6c36128..b2798be 100644 --- a/custom_components/fallback_conversation/manifest.json +++ b/custom_components/fallback_conversation/manifest.json @@ -13,5 +13,5 @@ "iot_class": "local_polling", "issue_tracker": "https://github.com/m50/ha-fallback-conversation/issues", "requirements": [], - "version": "1.0.0" + "version": "1.0.4" } \ No newline at end of file