Commit Graph

147 Commits

Author SHA1 Message Date
Fabio Natanael Kepler
1a92d4530e Fix playing TTS and local media source over DLNA (#134903)
Co-authored-by: Erik Montnemery <erik@montnemery.com>
2025-06-26 17:12:15 +02:00
epenet
de4a5fa30b Remove unnecessary DOMAIN alias in tests (s-z) (#146010) 2025-06-02 08:48:37 +02:00
epenet
c3ade400fb Use Platform constant in tests (#145801)
* Use Platform constant in tests

* spelling

* Fix platform
2025-05-28 15:51:37 +02:00
Paulus Schoutsen
e09dde2ea9 Allow TTS streams to generate temporary media source IDs (#145080)
* Allow TTS streams to generate temporary media source IDs

* Update tests/components/tts/test_media_source.py

Co-authored-by: Copilot <175728472+Copilot@users.noreply.github.com>

* Update assist snapshots

---------

Co-authored-by: Copilot <175728472+Copilot@users.noreply.github.com>
2025-05-19 12:04:19 -04:00
Paulus Schoutsen
4994229215 Track if TTS entity supports streaming input (#144697)
* Track if entity supports streaming

* Make class method
2025-05-12 13:44:39 -04:00
Paulus Schoutsen
b9aadb252f Point thumbnail TTS media source to right logo (#144162) 2025-05-03 17:21:22 -04:00
Paulus Schoutsen
c4eddc8d11 Ensure legacy TTS providers are hidden if entity exists (#143992) 2025-04-30 16:57:02 -04:00
Paulus Schoutsen
5dab9ba01b Allow streaming text into TTS ResultStream objects (#143745)
Allow streaming messages into TTS ResultStream
2025-04-30 08:21:19 -04:00
Paulus Schoutsen
f980434046 Clean up Text-to-Speech (#143744) 2025-04-30 04:29:35 +02:00
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
f32bb1a318 Assist satellite to use TTS tokens for announcements (#140336)
* Migrate Assist Satellite to use token

* Fix tests

* Fix tests
2025-03-13 08:36:38 -05: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
Erik Montnemery
428cc1a951 Update signature of platforms' async_setup_entry in tests (#138271) 2025-02-11 13:17:39 +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
Erik Montnemery
3e62c6ae2f Move core config functionality to its own module (#129065)
* Move core config functionality to its own module

* Adjust test
2024-10-24 13:34:51 +02: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
2190054abf Improve negative TTS test (#126126) 2024-09-17 16:11:03 +02:00
epenet
1a478bd78a Use root import for media_player and media_source in tests (#125829) 2024-09-12 14:55:29 +02: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
Marc Mueller
f11b316dac Import Generator from collections.abc (4) (#120917) 2024-07-01 11:54:42 +02:00
epenet
fd67fe417e Use ruff to force alias when importing PLATFORM_SCHEMA (#120539) 2024-06-26 14:22:52 +02:00
Marc Mueller
59e178df3b Import Generator from typing_extensions (5) (#118993) 2024-06-06 17:33:27 +02:00
J. Nick Koston
ed0568c655 Ensure config entries are not unloaded while their platforms are setting up (#118767)
* Report non-awaited/non-locked config entry platform forwards

Its currently possible for config entries to be reloaded while their platforms
are being forwarded if platform forwards are not awaited or done after the
config entry is setup since the lock will not be held in this case.

In https://developers.home-assistant.io/blog/2022/07/08/config_entry_forwards
we advised to await platform forwards to ensure this does not happen, however
for sleeping devices and late discovered devices, platform forwards may happen
later.

If config platform forwards are happening during setup, they should be awaited

If config entry platform forwards are not happening during setup, instead
async_late_forward_entry_setups should be used which will hold the lock to
prevent the config entry from being unloaded while its platforms are being
setup

* Report non-awaited/non-locked config entry platform forwards

Its currently possible for config entries to be reloaded while their platforms
are being forwarded if platform forwards are not awaited or done after the
config entry is setup since the lock will not be held in this case.

In https://developers.home-assistant.io/blog/2022/07/08/config_entry_forwards
we advised to await platform forwards to ensure this does not happen, however
for sleeping devices and late discovered devices, platform forwards may happen
later.

If config platform forwards are happening during setup, they should be awaited

If config entry platform forwards are not happening during setup, instead
async_late_forward_entry_setups should be used which will hold the lock to
prevent the config entry from being unloaded while its platforms are being
setup

* run with error on to find them

* cert_exp, hold lock

* cert_exp, hold lock

* shelly async_late_forward_entry_setups

* compact

* compact

* found another

* patch up mobileapp

* patch up hue tests

* patch up smartthings

* fix mqtt

* fix esphome

* zwave_js

* mqtt

* rework

* fixes

* fix mocking

* fix mocking

* do not call async_forward_entry_setup directly

* docstrings

* docstrings

* docstrings

* add comments

* doc strings

* fixed all in core, turn off strict

* coverage

* coverage

* missing

* coverage
2024-06-04 21:34:39 -04: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
J. Nick Koston
4f18f0d902 Fix setup timings when config entry platform loads are not awaited (#113959)
* Move setup time logging into the context manager

We were fetching the time twice but since the context
manager already has the timing, move it there

* remove log setup assertions from integration test

* tweak logging to give us better data for tracking issues

* redundant

* adjust

* preen

* fixes

* adjust

* make api change internal so nobody uses it

* coverage

* fix test

* fix more tests

* coverage

* more tests assuming internal calls

* fix more

* adjust

* adjust

* fix axis tests

* fix broadlink -- it does not call async_forward_entry_setup

* missed some

* remove useless patch

* rename, detect it both ways

* clear

* debug

* try to fix

* handle phase finishing out while paused

* where its set does not need to know its late as that is an implemenation detail of setup

* where its set does not need to know its late as that is an implemenation detail of setup

* tweak

* simplify

* reduce complexity

* revert order change as it makes review harder

* revert naming changes as it makes review harder

* improve comment

* improve debug

* late dispatch test

* test the other way as well

* Update setup.py

* Update setup.py

* Update setup.py

* simplify

* reduce
2024-03-23 15:26:38 -04:00
Sid
00ec7f11f0 Enable Ruff rule PT007 (#113764)
Co-authored-by: Franck Nijhof <frenck@frenck.nl>
2024-03-19 09:01:07 +01:00
J. Nick Koston
10f2d8b4b1 Move legacy notify setup to use tracked tasks (#113716)
* Move legacy notify setup to a tracked task

* fix test

* fix test

* comment
2024-03-18 13:09:21 +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
Marc Mueller
87165c0d6e Add empty line after module docstring [tests t-z] (#112712) 2024-03-08 14:44:56 +01:00