修复误删_config_entry导至无法正常工作的BUG

This commit is contained in:
Howell Jiang
2025-04-18 17:37:08 +00:00
parent 2d3f8cd3b0
commit 498560590c
2 changed files with 2 additions and 1 deletions
+1 -1
View File
@@ -130,7 +130,7 @@ class BaiduSTTEntity(stt.SpeechToTextEntity):
if "result" not in result or not result["result"]: if "result" not in result or not result["result"]:
return stt.SpeechResult( return stt.SpeechResult(
text=None, text=None,
result=stt.SpeechResultState.NO_SPEECH_DETECTED, result=stt.SpeechResultState.SUCCESS,
) )
return stt.SpeechResult( return stt.SpeechResult(
+1
View File
@@ -52,6 +52,7 @@ class BaiduTTSEntity(TextToSpeechEntity):
def __init__(self, hass: HomeAssistant, config_entry: ConfigEntry) -> None: def __init__(self, hass: HomeAssistant, config_entry: ConfigEntry) -> None:
"""Initialize the Baidu TTS entity.""" """Initialize the Baidu TTS entity."""
self._config_entry = config_entry
# Generate unique ID and set name # Generate unique ID and set name
app_id = config_entry.data[CONF_APP_ID] app_id = config_entry.data[CONF_APP_ID]
self._attr_unique_id = f"baidu_tts_{app_id}" self._attr_unique_id = f"baidu_tts_{app_id}"