Commit Graph

127 Commits (dc5bfba902ce531e97ccbb8385a49a298f8cee21)

Author SHA1 Message Date
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
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
Martin Hjelmare 6f97270cd2
Fix tts notify config validation (#98381)
* Add test

* Require either entity_id or tts_service
2023-08-14 13:30:25 +02:00
Erik Montnemery b254218dd6
Remove `base_url` configuration option from `tts` (#94905) 2023-06-21 11:20:33 +02:00
Erik Montnemery 4f669b326f
Fix typo in tts tests (#94725) 2023-06-16 21:08:14 -04: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 9a3077d64a
Always setup demo platforms with device support from config entry (#94586)
* Always setup demo platforms with device support from config entry

* Adjust test fixutres

* Update tests depending on the demo integration
2023-06-14 16:50:35 +02:00
c0ffeeca7 c3a3ddcfa4
Standardize spelling of TTS and STT (#93857)
* Standardize spelling of TTS and STT

* Apply suggestions from code review

* Update homeassistant/components/tts/media_source.py

---------

Co-authored-by: Paulus Schoutsen <paulus@home-assistant.io>
2023-05-31 11:00:19 -04:00
Erik Montnemery 3fc0c9a325
Improve TTS test fixtures (#93517) 2023-05-25 11:59:20 +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 0126cfa9d9
Allow exposing any entity to the default conversation agent (#92398)
* Allow exposing any entity to the default conversation agent

* Tweak

* Fix race, update tests

* Update tests
2023-05-03 09:45:54 -04:00
Franck Nijhof b6a3ffb20f
Revert "Fail TTS tests if default TTS cache dir exists (#92023)" (#92079) 2023-04-26 21:18:17 +02:00
Erik Montnemery 32ffedd365
Fail TTS tests if default TTS cache dir exists (#92023)
Fail tests if default tts cache dir exists
2023-04-26 15:28:48 +02:00
Martin Hjelmare 0594fefb0c
Clean up tts fixtures (#92025) 2023-04-25 22:21:18 +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