Convert async_get_conversation_languages from async to callback (#121162)
* Convert get_languages to callback * One more callback
This commit is contained in:
parent
cf96084ea3
commit
869f24df49
3 changed files with 10 additions and 8 deletions
|
@ -115,7 +115,8 @@ AUDIO_PROCESSOR_SAMPLES: Final = 160 # 10 ms @ 16 Khz
|
|||
AUDIO_PROCESSOR_BYTES: Final = AUDIO_PROCESSOR_SAMPLES * 2 # 16-bit samples
|
||||
|
||||
|
||||
async def _async_resolve_default_pipeline_settings(
|
||||
@callback
|
||||
def _async_resolve_default_pipeline_settings(
|
||||
hass: HomeAssistant,
|
||||
stt_engine_id: str | None,
|
||||
tts_engine_id: str | None,
|
||||
|
@ -139,7 +140,7 @@ async def _async_resolve_default_pipeline_settings(
|
|||
# Find a matching language supported by the Home Assistant conversation agent
|
||||
conversation_languages = language_util.matches(
|
||||
hass.config.language,
|
||||
await conversation.async_get_conversation_languages(
|
||||
conversation.async_get_conversation_languages(
|
||||
hass, conversation.HOME_ASSISTANT_AGENT
|
||||
),
|
||||
country=hass.config.country,
|
||||
|
@ -222,7 +223,7 @@ async def _async_create_default_pipeline(
|
|||
The default pipeline will use the homeassistant conversation agent and the
|
||||
default stt / tts engines.
|
||||
"""
|
||||
pipeline_settings = await _async_resolve_default_pipeline_settings(
|
||||
pipeline_settings = _async_resolve_default_pipeline_settings(
|
||||
hass, stt_engine_id=None, tts_engine_id=None, pipeline_name="Home Assistant"
|
||||
)
|
||||
return await pipeline_store.async_create_item(pipeline_settings)
|
||||
|
@ -241,7 +242,7 @@ async def async_create_default_pipeline(
|
|||
"""
|
||||
pipeline_data: PipelineData = hass.data[DOMAIN]
|
||||
pipeline_store = pipeline_data.pipeline_store
|
||||
pipeline_settings = await _async_resolve_default_pipeline_settings(
|
||||
pipeline_settings = _async_resolve_default_pipeline_settings(
|
||||
hass, stt_engine_id, tts_engine_id, pipeline_name=pipeline_name
|
||||
)
|
||||
if (
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue