mirror of
https://github.com/howelljiang/baidu-voice.git
synced 2026-07-21 22:53:57 +08:00
修复误删_config_entry导至无法正常工作的BUG
This commit is contained in:
@@ -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(
|
||||||
|
|||||||
@@ -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}"
|
||||||
|
|||||||
Reference in New Issue
Block a user