diff --git a/homeassistant/components/assist_pipeline/error.py b/homeassistant/components/assist_pipeline/error.py index fa26d916eeb7..c5ffdcaf2d34 100644 --- a/homeassistant/components/assist_pipeline/error.py +++ b/homeassistant/components/assist_pipeline/error.py @@ -19,7 +19,7 @@ class PipelineNotFound(PipelineError): class SpeechToTextError(PipelineError): - """Error in speech to text portion of pipeline.""" + """Error in speech-to-text portion of pipeline.""" class IntentRecognitionError(PipelineError): @@ -27,4 +27,4 @@ class IntentRecognitionError(PipelineError): class TextToSpeechError(PipelineError): - """Error in text to speech portion of pipeline.""" + """Error in text-to-speech portion of pipeline.""" diff --git a/homeassistant/components/assist_pipeline/pipeline.py b/homeassistant/components/assist_pipeline/pipeline.py index 6a4bbdf61e69..c169ab657b86 100644 --- a/homeassistant/components/assist_pipeline/pipeline.py +++ b/homeassistant/components/assist_pipeline/pipeline.py @@ -125,7 +125,7 @@ async def _async_resolve_default_pipeline_settings( stt_language = stt_languages[0] else: _LOGGER.debug( - "Speech to text engine '%s' does not support language '%s'", + "Speech-to-text engine '%s' does not support language '%s'", stt_engine_id, pipeline_language, ) @@ -152,7 +152,7 @@ async def _async_resolve_default_pipeline_settings( tts_voice = tts_voices[0].voice_id else: _LOGGER.debug( - "Text to speech engine '%s' does not support language '%s'", + "Text-to-speech engine '%s' does not support language '%s'", tts_engine_id, pipeline_language, ) @@ -387,7 +387,7 @@ class PipelineRun: ) async def prepare_speech_to_text(self, metadata: stt.SpeechMetadata) -> None: - """Prepare speech to text.""" + """Prepare speech-to-text.""" # pipeline.stt_engine can't be None or this function is not called stt_provider = stt.async_get_speech_to_text_engine( self.hass, @@ -398,7 +398,7 @@ class PipelineRun: engine = self.pipeline.stt_engine raise SpeechToTextError( code="stt-provider-missing", - message=f"No speech to text provider for: {engine}", + message=f"No speech-to-text provider for: {engine}", ) metadata.language = self.pipeline.stt_language or self.language @@ -419,7 +419,7 @@ class PipelineRun: metadata: stt.SpeechMetadata, stream: AsyncIterable[bytes], ) -> str: - """Run speech to text portion of pipeline. Returns the spoken text.""" + """Run speech-to-text portion of pipeline. Returns the spoken text.""" if isinstance(self.stt_provider, stt.Provider): engine = self.stt_provider.name else: @@ -441,10 +441,10 @@ class PipelineRun: metadata, stream ) except Exception as src_error: - _LOGGER.exception("Unexpected error during speech to text") + _LOGGER.exception("Unexpected error during speech-to-text") raise SpeechToTextError( code="stt-stream-failed", - message="Unexpected error during speech to text", + message="Unexpected error during speech-to-text", ) from src_error _LOGGER.debug("speech-to-text result %s", result) @@ -452,7 +452,7 @@ class PipelineRun: if result.result != stt.SpeechResultState.SUCCESS: raise SpeechToTextError( code="stt-stream-failed", - message="Speech to text failed", + message="speech-to-text failed", ) if not result.text: @@ -541,7 +541,7 @@ class PipelineRun: return speech async def prepare_text_to_speech(self) -> None: - """Prepare text to speech.""" + """Prepare text-to-speech.""" # pipeline.tts_engine can't be None or this function is not called engine = cast(str, self.pipeline.tts_engine) @@ -562,13 +562,13 @@ class PipelineRun: except HomeAssistantError as err: raise TextToSpeechError( code="tts-not-supported", - message=f"Text to speech engine '{engine}' not found", + message=f"Text-to-speech engine '{engine}' not found", ) from err if not options_supported: raise TextToSpeechError( code="tts-not-supported", message=( - f"Text to speech engine {engine} " + f"Text-to-speech engine {engine} " f"does not support language {self.pipeline.tts_language} or options {tts_options}" ), ) @@ -577,7 +577,7 @@ class PipelineRun: self.tts_options = tts_options async def text_to_speech(self, tts_input: str) -> str: - """Run text to speech portion of pipeline. Returns URL of TTS audio.""" + """Run text-to-speech portion of pipeline. Returns URL of TTS audio.""" self.process_event( PipelineEvent( PipelineEventType.TTS_START, @@ -605,10 +605,10 @@ class PipelineRun: None, ) except Exception as src_error: - _LOGGER.exception("Unexpected error during text to speech") + _LOGGER.exception("Unexpected error during text-to-speech") raise TextToSpeechError( code="tts-failed", - message="Unexpected error during text to speech", + message="Unexpected error during text-to-speech", ) from src_error _LOGGER.debug("TTS result %s", tts_media) @@ -644,7 +644,7 @@ class PipelineInput: """Input for conversation agent. Required when start_stage = intent.""" tts_input: str | None = None - """Input for text to speech. Required when start_stage = tts.""" + """Input for text-to-speech. Required when start_stage = tts.""" conversation_id: str | None = None @@ -654,7 +654,7 @@ class PipelineInput: current_stage = self.run.start_stage try: - # Speech to text + # speech-to-text intent_input = self.intent_input if current_stage == PipelineStage.STT: assert self.stt_metadata is not None @@ -696,15 +696,15 @@ class PipelineInput: if self.run.start_stage == PipelineStage.STT: if self.run.pipeline.stt_engine is None: raise PipelineRunValidationError( - "the pipeline does not support speech to text" + "the pipeline does not support speech-to-text" ) if self.stt_metadata is None: raise PipelineRunValidationError( - "stt_metadata is required for speech to text" + "stt_metadata is required for speech-to-text" ) if self.stt_stream is None: raise PipelineRunValidationError( - "stt_stream is required for speech to text" + "stt_stream is required for speech-to-text" ) elif self.run.start_stage == PipelineStage.INTENT: if self.intent_input is None: @@ -714,12 +714,12 @@ class PipelineInput: elif self.run.start_stage == PipelineStage.TTS: if self.tts_input is None: raise PipelineRunValidationError( - "tts_input is required for text to speech" + "tts_input is required for text-to-speech" ) if self.run.end_stage == PipelineStage.TTS: if self.run.pipeline.tts_engine is None: raise PipelineRunValidationError( - "the pipeline does not support text to speech" + "the pipeline does not support text-to-speech" ) start_stage_index = PIPELINE_STAGE_ORDER.index(self.run.start_stage) diff --git a/homeassistant/components/assist_pipeline/websocket_api.py b/homeassistant/components/assist_pipeline/websocket_api.py index 6c1dbe3dbce9..a4afbe9266ab 100644 --- a/homeassistant/components/assist_pipeline/websocket_api.py +++ b/homeassistant/components/assist_pipeline/websocket_api.py @@ -151,7 +151,7 @@ async def websocket_run( # Input to conversation agent input_args["intent_input"] = msg["input"]["text"] elif start_stage == PipelineStage.TTS: - # Input to text to speech system + # Input to text-to-speech system input_args["tts_input"] = msg["input"]["text"] input_args["run"] = PipelineRun( diff --git a/homeassistant/components/cloud/tts.py b/homeassistant/components/cloud/tts.py index 480ca06bf77c..88f24d1290f7 100644 --- a/homeassistant/components/cloud/tts.py +++ b/homeassistant/components/cloud/tts.py @@ -1,4 +1,4 @@ -"""Support for the cloud for text to speech service.""" +"""Support for the cloud for text-to-speech service.""" from __future__ import annotations import logging diff --git a/homeassistant/components/demo/stt.py b/homeassistant/components/demo/stt.py index 07a844c048cc..6458bf473975 100644 --- a/homeassistant/components/demo/stt.py +++ b/homeassistant/components/demo/stt.py @@ -1,4 +1,4 @@ -"""Support for the demo for speech to text service.""" +"""Support for the demo for speech-to-text service.""" from __future__ import annotations from collections.abc import AsyncIterable diff --git a/homeassistant/components/demo/tts.py b/homeassistant/components/demo/tts.py index 43138f888e98..dfc8d7d7efb1 100644 --- a/homeassistant/components/demo/tts.py +++ b/homeassistant/components/demo/tts.py @@ -1,4 +1,4 @@ -"""Support for the demo for text to speech service.""" +"""Support for the demo for text-to-speech service.""" from __future__ import annotations import os diff --git a/homeassistant/components/google_translate/manifest.json b/homeassistant/components/google_translate/manifest.json index 5321d13c5d61..504925a4667f 100644 --- a/homeassistant/components/google_translate/manifest.json +++ b/homeassistant/components/google_translate/manifest.json @@ -1,6 +1,6 @@ { "domain": "google_translate", - "name": "Google Translate Text-to-Speech", + "name": "Google Translate text-to-speech", "codeowners": [], "documentation": "https://www.home-assistant.io/integrations/google_translate", "iot_class": "cloud_push", diff --git a/homeassistant/components/stt/__init__.py b/homeassistant/components/stt/__init__.py index 5e34a567c9ef..516cd4ddea10 100644 --- a/homeassistant/components/stt/__init__.py +++ b/homeassistant/components/stt/__init__.py @@ -413,7 +413,7 @@ def _metadata_from_header(request: web.Request) -> SpeechMetadata: def websocket_list_engines( hass: HomeAssistant, connection: websocket_api.ActiveConnection, msg: dict ) -> None: - """List speech to text engines and, optionally, if they support a given language.""" + """List speech-to-text engines and, optionally, if they support a given language.""" component: EntityComponent[SpeechToTextEntity] = hass.data[DOMAIN] legacy_providers: dict[str, Provider] = hass.data[DATA_PROVIDERS] diff --git a/homeassistant/components/stt/legacy.py b/homeassistant/components/stt/legacy.py index f2a5854e5678..9ee3f0bb8ad4 100644 --- a/homeassistant/components/stt/legacy.py +++ b/homeassistant/components/stt/legacy.py @@ -1,4 +1,4 @@ -"""Handle legacy speech to text platforms.""" +"""Handle legacy speech-to-text platforms.""" from __future__ import annotations from abc import ABC, abstractmethod @@ -51,7 +51,7 @@ def async_get_provider( def async_setup_legacy( hass: HomeAssistant, config: ConfigType ) -> list[Coroutine[Any, Any, None]]: - """Set up legacy speech to text providers.""" + """Set up legacy speech-to-text providers.""" providers = hass.data[DATA_PROVIDERS] = {} async def async_setup_platform(p_type, p_config=None, discovery_info=None): @@ -61,7 +61,7 @@ def async_setup_legacy( platform = await async_prepare_setup_platform(hass, config, DOMAIN, p_type) if platform is None: - _LOGGER.error("Unknown speech to text platform specified") + _LOGGER.error("Unknown speech-to-text platform specified") return try: diff --git a/homeassistant/components/stt/manifest.json b/homeassistant/components/stt/manifest.json index 73eb0fa4c079..53bb7fa19379 100644 --- a/homeassistant/components/stt/manifest.json +++ b/homeassistant/components/stt/manifest.json @@ -1,6 +1,6 @@ { "domain": "stt", - "name": "Speech-to-Text (STT)", + "name": "Speech-to-text (STT)", "codeowners": ["@home-assistant/core", "@pvizeli"], "dependencies": ["http"], "documentation": "https://www.home-assistant.io/integrations/stt", diff --git a/homeassistant/components/tts/legacy.py b/homeassistant/components/tts/legacy.py index e4e146b72dec..619c93746220 100644 --- a/homeassistant/components/tts/legacy.py +++ b/homeassistant/components/tts/legacy.py @@ -112,7 +112,7 @@ SCHEMA_SERVICE_SAY = vol.Schema( async def async_setup_legacy( hass: HomeAssistant, config: ConfigType ) -> list[Coroutine[Any, Any, None]]: - """Set up legacy text to speech providers.""" + """Set up legacy text-to-speech providers.""" tts: SpeechManager = hass.data[DATA_TTS_MANAGER] # Load service descriptions from tts/services.yaml @@ -132,7 +132,7 @@ async def async_setup_legacy( platform = await async_prepare_setup_platform(hass, config, DOMAIN, p_type) if platform is None: - _LOGGER.error("Unknown text to speech platform specified") + _LOGGER.error("Unknown text-to-speech platform specified") return try: diff --git a/homeassistant/components/tts/manifest.json b/homeassistant/components/tts/manifest.json index 741edbc4cefb..249e427c5913 100644 --- a/homeassistant/components/tts/manifest.json +++ b/homeassistant/components/tts/manifest.json @@ -1,6 +1,6 @@ { "domain": "tts", - "name": "Text-to-Speech (TTS)", + "name": "Text-to-speech (TTS)", "after_dependencies": ["media_player"], "codeowners": ["@home-assistant/core", "@pvizeli"], "dependencies": ["http"], diff --git a/homeassistant/components/tts/media_source.py b/homeassistant/components/tts/media_source.py index 34dc3822e93c..9fc0d40dae08 100644 --- a/homeassistant/components/tts/media_source.py +++ b/homeassistant/components/tts/media_source.py @@ -104,7 +104,7 @@ def media_source_id_to_kwargs(media_source_id: str) -> MediaSourceOptions: class TTSMediaSource(MediaSource): """Provide text-to-speech providers as media sources.""" - name: str = "Text to Speech" + name: str = "Text-to-speech" def __init__(self, hass: HomeAssistant) -> None: """Initialize TTSMediaSource.""" diff --git a/homeassistant/components/wyoming/stt.py b/homeassistant/components/wyoming/stt.py index 8d3f65345027..3f5487881a32 100644 --- a/homeassistant/components/wyoming/stt.py +++ b/homeassistant/components/wyoming/stt.py @@ -1,4 +1,4 @@ -"""Support for Wyoming speech to text services.""" +"""Support for Wyoming speech-to-text services.""" from collections.abc import AsyncIterable import logging @@ -23,7 +23,7 @@ async def async_setup_entry( config_entry: ConfigEntry, async_add_entities: AddEntitiesCallback, ) -> None: - """Set up Wyoming speech to text.""" + """Set up Wyoming speech-to-text.""" service: WyomingService = hass.data[DOMAIN][config_entry.entry_id] async_add_entities( [ @@ -33,7 +33,7 @@ async def async_setup_entry( class WyomingSttProvider(stt.SpeechToTextEntity): - """Wyoming speech to text provider.""" + """Wyoming speech-to-text provider.""" def __init__( self, diff --git a/homeassistant/components/wyoming/tts.py b/homeassistant/components/wyoming/tts.py index 42439280a3b5..0fc7bf5e6c4c 100644 --- a/homeassistant/components/wyoming/tts.py +++ b/homeassistant/components/wyoming/tts.py @@ -1,4 +1,4 @@ -"""Support for Wyoming text to speech services.""" +"""Support for Wyoming text-to-speech services.""" from collections import defaultdict import io import logging @@ -25,7 +25,7 @@ async def async_setup_entry( config_entry: ConfigEntry, async_add_entities: AddEntitiesCallback, ) -> None: - """Set up Wyoming speech to text.""" + """Set up Wyoming speech-to-text.""" service: WyomingService = hass.data[DOMAIN][config_entry.entry_id] async_add_entities( [ @@ -35,7 +35,7 @@ async def async_setup_entry( class WyomingTtsProvider(tts.TextToSpeechEntity): - """Wyoming text to speech provider.""" + """Wyoming text-to-speech provider.""" def __init__( self, diff --git a/homeassistant/config.py b/homeassistant/config.py index 0a5da91d9421..4ef1da1e6470 100644 --- a/homeassistant/config.py +++ b/homeassistant/config.py @@ -96,7 +96,7 @@ default_config: frontend: themes: !include_dir_merge_named themes -# Text to speech +# Text-to-speech tts: - platform: google_translate diff --git a/homeassistant/generated/integrations.json b/homeassistant/generated/integrations.json index c91d7f888c39..6418e93aa033 100644 --- a/homeassistant/generated/integrations.json +++ b/homeassistant/generated/integrations.json @@ -2080,7 +2080,7 @@ "integration_type": "hub", "config_flow": false, "iot_class": "cloud_push", - "name": "Google Translate Text-to-Speech" + "name": "Google Translate text-to-speech" }, "google_travel_time": { "integration_type": "hub", diff --git a/script/microsoft_tts.py b/script/microsoft_tts.py index 128c287345c3..bc0b577c97c5 100644 --- a/script/microsoft_tts.py +++ b/script/microsoft_tts.py @@ -1,4 +1,4 @@ -"""Helper script to update supported languages for Microsoft Text-to-Speech (TTS).""" +"""Helper script to update supported languages for Microsoft text-to-speech (TTS).""" from pathlib import Path from lxml import html diff --git a/tests/components/assist_pipeline/test_websocket.py b/tests/components/assist_pipeline/test_websocket.py index 95e2c33ef5b2..230440733687 100644 --- a/tests/components/assist_pipeline/test_websocket.py +++ b/tests/components/assist_pipeline/test_websocket.py @@ -132,7 +132,7 @@ async def test_audio_pipeline( assert msg["event"]["data"] == snapshot events.append(msg["event"]) - # text to speech + # text-to-speech msg = await client.receive_json() assert msg["event"]["type"] == "tts-start" assert msg["event"]["data"] == snapshot @@ -532,7 +532,7 @@ async def test_tts_failed( init_components, snapshot: SnapshotAssertion, ) -> None: - """Test pipeline run with text to speech error.""" + """Test pipeline run with text-to-speech error.""" events = [] client = await hass_ws_client(hass) @@ -595,7 +595,7 @@ async def test_tts_provider_missing( mock_tts_provider, snapshot: SnapshotAssertion, ) -> None: - """Test pipeline run with text to speech error.""" + """Test pipeline run with text-to-speech error.""" client = await hass_ws_client(hass) with patch( @@ -624,7 +624,7 @@ async def test_tts_provider_bad_options( mock_tts_provider, snapshot: SnapshotAssertion, ) -> None: - """Test pipeline run with text to speech error.""" + """Test pipeline run with text-to-speech error.""" client = await hass_ws_client(hass) with patch( @@ -1227,7 +1227,7 @@ async def test_audio_pipeline_debug( assert msg["event"]["data"] == snapshot events.append(msg["event"]) - # text to speech + # text-to-speech msg = await client.receive_json() assert msg["event"]["type"] == "tts-start" assert msg["event"]["data"] == snapshot diff --git a/tests/components/microsoft/__init__.py b/tests/components/microsoft/__init__.py index 5c1ed8dad090..10e98be7c01d 100644 --- a/tests/components/microsoft/__init__.py +++ b/tests/components/microsoft/__init__.py @@ -1 +1 @@ -"""Tests for the Microsoft Text-to-Speech component.""" +"""Tests for the Microsoft text-to-speech component.""" diff --git a/tests/components/microsoft/test_tts.py b/tests/components/microsoft/test_tts.py index dd183ae7120e..9684d1aa7d5a 100644 --- a/tests/components/microsoft/test_tts.py +++ b/tests/components/microsoft/test_tts.py @@ -1,4 +1,4 @@ -"""Tests for Microsoft Text-to-Speech.""" +"""Tests for Microsoft text-to-speech.""" from unittest.mock import patch from pycsspeechtts import pycsspeechtts diff --git a/tests/components/stt/test_init.py b/tests/components/stt/test_init.py index 5a7e93a72a27..4100df94b9ee 100644 --- a/tests/components/stt/test_init.py +++ b/tests/components/stt/test_init.py @@ -392,7 +392,7 @@ async def test_ws_list_engines( setup: MockProvider | MockProviderEntity, engine_id: str, ) -> None: - """Test listing speech to text engines.""" + """Test listing speech-to-text engines.""" client = await hass_ws_client() await client.send_json_auto_id({"type": "stt/engine/list"}) diff --git a/tests/components/stt/test_legacy.py b/tests/components/stt/test_legacy.py index a95a1f0f6f49..7176b866b002 100644 --- a/tests/components/stt/test_legacy.py +++ b/tests/components/stt/test_legacy.py @@ -26,7 +26,7 @@ async def test_invalid_platform( ) await hass.async_block_till_done() - assert "Unknown speech to text platform specified" in caplog.text + assert "Unknown speech-to-text platform specified" in caplog.text async def test_platform_setup_with_error( diff --git a/tests/components/tts/test_legacy.py b/tests/components/tts/test_legacy.py index aa1efaf6f669..26b7c2397b48 100644 --- a/tests/components/tts/test_legacy.py +++ b/tests/components/tts/test_legacy.py @@ -71,7 +71,7 @@ async def test_invalid_platform( ) await hass.async_block_till_done() - assert "Unknown text to speech platform specified" in caplog.text + assert "Unknown text-to-speech platform specified" in caplog.text async def test_platform_setup_without_provider( diff --git a/tests/components/tts/test_media_source.py b/tests/components/tts/test_media_source.py index 6065c97d6d65..86f1a3bcf3e2 100644 --- a/tests/components/tts/test_media_source.py +++ b/tests/components/tts/test_media_source.py @@ -52,7 +52,7 @@ async def test_browsing(hass: HomeAssistant, setup: str) -> None: item = await media_source.async_browse_media(hass, "media-source://tts") assert item is not None - assert item.title == "Text to Speech" + assert item.title == "Text-to-speech" assert item.children is not None assert len(item.children) == 1 assert item.can_play is False