101 Commits

Author SHA1 Message Date
Joost Lekkerkerker
dcc63a6f2e
Bump ruff to 0.10.0 (#140541)
* Bump ruff to 0.10.0

* Bump ruff to 0.10.0

* Bump ruff to 0.10.0

* Bump ruff to 0.10.0

* Update pyproject.toml

Co-authored-by: Marc Mueller <30130371+cdce8p@users.noreply.github.com>

* Fix

---------

Co-authored-by: Marc Mueller <30130371+cdce8p@users.noreply.github.com>
2025-03-14 12:32:50 +00:00
Paulus Schoutsen
55895df54d
Switch more TTS core to async generators (#140432)
* Switch more TTS core to async generators

* Document a design choice

* robust

* Add more tests

* Update comment

* Clarify and document TTSCache variables
2025-03-13 13:24:44 -04:00
Paulus Schoutsen
0ba5711603
Add TTS token to TTS-END event (#140333) 2025-03-11 17:54:39 +01:00
Paulus Schoutsen
2cce1b024e
Migrate Assist Pipeline to use TTS stream (#139542)
* Migrate Pipeline to use TTS stream

* Fix tests
2025-03-01 21:43:00 +01:00
Paulus Schoutsen
1a80934593
Move TTS entity to own file (#139538)
* Move entity to own file

* Move entity tests
2025-02-28 20:40:13 +01:00
Paulus Schoutsen
70bb56e0fc
Text-to-Speech refactor (#139482)
* Refactor TTS

* More cleanup

* Cleanup

* Consolidate more

* Inline another function

* Inline another function

* Improve cleanup
2025-02-28 12:36:12 -06:00
Erik Montnemery
af0a862aab
Clean up translations for mocked integrations inbetween tests (#138732)
* Clean up translations for mocked integrations inbetween tests

* Adjust code, add test

* Fix docstring

* Improve cleanup, add test

* Fix test
2025-02-19 13:49:31 +01:00
epenet
d0a188b86d
Standardize homeassistant imports in component tests (m-z) (#136807) 2025-01-29 08:57:57 +01:00
G Johansson
5a7b6cd7a0
Remove asserting name in tts test (no entity platform) (#135726)
* Ensure entity platform in tts tests

* Correct placement

* Remove name test

* Remove hass
2025-01-18 14:47:53 +01:00
epenet
c4e5b59326
Fix more flaky translation checks (#131824) 2024-11-28 13:41:30 +01:00
epenet
d6f4a79b46
Remove workaround for flaky translation tests (#131628) 2024-11-27 08:37:36 -06:00
Michael Hansen
d4071e7123
Hide TTS filename behind random token (#131192)
* Hide TTS filename behind random token

* Clean up and fix test snapshots

* Fix tests

* Fix cloud tests
2024-11-24 20:52:21 -05:00
tronikos
4c0fb04f61
Make tts options of type list (such as profiles in google_cloud) work (#121582)
* Allow tts options of type list such as profiles in google_cloud

* Update tests/components/tts/test_media_source.py

* Don't mix engine specific options with other options

* Fix test

* Update assist_pipeline snapshots

---------

Co-authored-by: Paulus Schoutsen <balloob@gmail.com>
Co-authored-by: Paulus Schoutsen <paulus@home-assistant.io>
Co-authored-by: Erik Montnemery <erik@montnemery.com>
2024-09-24 00:07:12 -07:00
Erik Montnemery
cff4e46694
Deduplicate TTS mocks (#124773) 2024-08-28 13:48:49 +02:00
Erik Montnemery
ef1d53c207
Include engine name in TTS WS responses (#124683) 2024-08-27 11:14:41 +02:00
Erik Montnemery
715f4bd2c3
Set deprecated flag on TTS engines replaced by entities in WS list (#124676) 2024-08-27 10:09:49 +02:00
Paulus Schoutsen
156948c496
Fix defaults for cloud STT/TTS (#121229)
* Fix defaults for cloud STT/TTS

* Prefer entity over legacy provider

* Remove unrealistic tests

* Add tests which show cloud stt/tts entity is preferred

---------

Co-authored-by: Erik <erik@montnemery.com>
2024-08-26 19:39:09 +02:00
Erik Montnemery
f4528b288f
Fix overriding name in MockTTSEntity (#124639)
* Fix overriding name in MockTTSEntity

* Fix
2024-08-26 15:28:55 +02:00
Erik Montnemery
cafd953f87
Add test showing we prefer tts entity over legacy tts provider (#124624) 2024-08-26 11:10:58 +02:00
epenet
ad26db7dc8
Replace pylint broad-exception-raised rule with ruff (#123021) 2024-08-02 12:24:03 +02:00
Sid
e2141dc208
Add _attr class attributes to TextToSpeechEntity (#115684) 2024-07-07 16:21:04 +02:00
J. Nick Koston
e8ef2c2822
Fix blocking I/O in tts tests (#121143) 2024-07-04 05:21:01 +01:00
epenet
f178467b0e
Add type hints for TTS test fixtures (#118704) 2024-06-03 17:43:18 +02:00
epenet
9204ccfa17
Use is in ConfigEntryState enum comparison in tests (N-Z) (#114926) 2024-04-05 17:37:00 +02:00
Joost Lekkerkerker
6bb4e7d62c
Bump ruff to 0.3.4 (#112690)
Co-authored-by: Sid <27780930+autinerd@users.noreply.github.com>
Co-authored-by: Marc Mueller <30130371+cdce8p@users.noreply.github.com>
Co-authored-by: J. Nick Koston <nick@koston.org>
2024-03-26 00:02:16 +01:00
Sid
00ec7f11f0
Enable Ruff rule PT007 (#113764)
Co-authored-by: Franck Nijhof <frenck@frenck.nl>
2024-03-19 09:01:07 +01:00
Erik Montnemery
dd9fdac51e
Remove unused tts fixture (#113480) 2024-03-14 22:25:10 -10:00
Joost Lekkerkerker
7ae852e5ed
Enable ISC ruff rule (#113270) 2024-03-14 10:43:03 +01:00
Marc Mueller
32f3f46542
Add empty line after module docstring (2) [tests.components] (#112737) 2024-03-08 19:16:21 +01:00
J. Nick Koston
09b65f14b9
Index entities by domain for entity services (#106759) 2024-01-02 15:28:58 +01:00
Jan-Philipp Benecke
fbfe434e8b
Migrate tag & tts tests to use freezegun (#105411) 2023-12-11 09:09:23 +01:00
Erik Montnemery
84e74e4c74
Reverse component path (#104087)
* Reverse component path

* Update translations helper

* Fix

* Revert incorrect change of PLATFORM_FORMAT

* Fix use of PLATFORM_FORMAT in tts

* Fix ios
2023-12-05 08:43:58 +01:00
Michael Hansen
ae516ffbb5
Automatically convert TTS audio to MP3 on demand (#102814)
* Add ATTR_PREFERRED_FORMAT to TTS for auto-converting audio

* Move conversion into SpeechManager

* Handle None case for expected_extension

* Only use ATTR_AUDIO_OUTPUT

* Prefer MP3 in pipelines

* Automatically convert to mp3 on demand

* Add preferred audio format

* Break out preferred format

* Add ATTR_BLOCKING to allow async fetching

* Make a copy of supported options

* Fix MaryTTS tests

* Update ESPHome to use "wav" instead of "raw"

* Clean up tests, remove blocking

* Clean up rest of TTS tests

* Fix ESPHome tests

* More test coverage
2023-11-06 15:26:00 -05:00
Erik Montnemery
b254218dd6
Remove base_url configuration option from tts (#94905) 2023-06-21 11:20:33 +02:00
Erik Montnemery
334dacc322
Change Entity.name default to UNDEFINED (#94574)
* Change Entity.name default to UNDEFINED

* Update typing

* Update Pylint plugin

* Update TTS test
2023-06-15 11:09:53 +02:00
Erik Montnemery
30d9d7d905
Minor adjustment of tts typing (#93450) 2023-05-24 21:02:55 +02:00
Erik Montnemery
68379dd55a
Improve TTS cache dir mocking (#93468) 2023-05-24 21:00:35 +02:00
Bram Kragten
75f8ea48f4
Add tts get engine ws command (#92336)
Co-authored-by: Erik Montnemery <erik@montnemery.com>
2023-05-11 10:51:00 +02:00
Erik Montnemery
792ea92e55
Remove fuzzy language matching from stt and tts (#92002)
* Remove fuzzy language matching from stt and tts

* Update tests
2023-04-25 17:54:42 +02:00
Erik Montnemery
9a0de43f98
Add name to tts voices (#91814)
* Add name to tts voices

* Add new file
2023-04-21 20:41:14 -04:00
Martin Hjelmare
1a18dc7425
Add tts entity (#91692)
* Add tts entity

* Allow passing engine id to url view

* Update async_resolve_engine

* Add and update more tests

* Fix assist pipeline tests temporarily

* Move fixtures

* Update notify platform

* Complete legacy tests

* Update media source tests

* Update async_get_text_to_speech_languages

* Address comment

---------

Co-authored-by: Paulus Schoutsen <balloob@gmail.com>
2023-04-20 22:55:46 -04:00
Erik Montnemery
79de27a4a9
Include matching languages in WS tts/engine/list (#91732)
* Include matching languages in WS tts/engine/list

* Allow specifying country
2023-04-20 08:56:50 -04:00
Erik Montnemery
f3e6d6dfc0
Add async_get_supported_voices to tts.Provider (#91649)
* Add async_get_supported_voices to tts.Provider

* Update WS API
2023-04-19 13:47:49 +02:00
Michael Hansen
f96515b90a
Use language util in stt/tts (#91521)
* Use language util in stt/tts

* Test language util in stt/tts

* Fix common in TTS

* Update snapshot
2023-04-17 23:23:43 -04:00
Erik Montnemery
e32dacc62d
Add WS API to tts (#91330)
* Add WS API to tts

* Use language util, change from entity_id to engine_id

* Fix rebase mistake
2023-04-17 22:52:19 +02:00
Martin Hjelmare
9bd12f6503
Move legacy tts (#91538)
* Move legacy tts

* Add error log on unknown platform

* Add legacy tests and delint all tests

* Consolidate log format

* Add more legacy tests

* Test default legacy provider attributes

* Remove test generated files

* Clean up after merge conflict
2023-04-17 13:01:50 -04:00
epenet
9e1a670e6e
Fail CI on lingering timers (part 2) (#89976)
* Fail CI on lingering timers (part 2)

* Improve error message

* Adjust tts
2023-04-13 17:03:52 +02:00
Paulus Schoutsen
86e9f6643f
Allow TTS requests to resolve in the background (#90944) 2023-04-06 10:42:55 -05:00
Paulus Schoutsen
8018be28ee
TTS: allow resolving engine and test supported options (#90539)
TTS: allow resolving engine
2023-03-31 13:34:42 -05:00
Erik Montnemery
f84651b14e
Improve tts test coverage (#90370) 2023-03-27 20:00:54 +02:00