From 95e4ef225585891edae6280e025bb7b6b268c74a Mon Sep 17 00:00:00 2001 From: Tudor Sandu Date: Fri, 2 Jun 2023 03:10:57 +0300 Subject: [PATCH] Fix states not being translated in voice assistants (#93572) Fix states not being translated --- homeassistant/components/conversation/default_agent.py | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/homeassistant/components/conversation/default_agent.py b/homeassistant/components/conversation/default_agent.py index 5cb4487de65..44b13522412 100644 --- a/homeassistant/components/conversation/default_agent.py +++ b/homeassistant/components/conversation/default_agent.py @@ -278,13 +278,13 @@ class DefaultAgent(AbstractConversationAgent): all_states = matched + unmatched domains = {state.domain for state in all_states} translations = await translation.async_get_translations( - self.hass, language, "state", domains + self.hass, language, "entity_component", domains ) # Use translated state names for state in all_states: device_class = state.attributes.get("device_class", "_") - key = f"component.{state.domain}.state.{device_class}.{state.state}" + key = f"component.{state.domain}.entity_component.{device_class}.state.{state.state}" state.state = translations.get(key, state.state) # Get first matched or unmatched state.