From cb23b4503f96ec456342227d30fcd53e830ff5b9 Mon Sep 17 00:00:00 2001 From: sayam93 <163408168+sayam93@users.noreply.github.com> Date: Wed, 11 Dec 2024 03:04:22 +0530 Subject: [PATCH 1/2] fix: TTS Speak Action in Home Assistant Fixes the broken TTS action in Home Assistant that was broken in 5.0.3 --- custom_components/alexa_media/media_player.py | 24 ++++++------------- 1 file changed, 7 insertions(+), 17 deletions(-) diff --git a/custom_components/alexa_media/media_player.py b/custom_components/alexa_media/media_player.py index 42fc597d..b5fa0e80 100644 --- a/custom_components/alexa_media/media_player.py +++ b/custom_components/alexa_media/media_player.py @@ -41,7 +41,6 @@ ) from .alexa_media import AlexaMedia from .const import ( - ANNOUNCE_ERROR_MESSAGE, DEPENDENT_ALEXA_COMPONENTS, MIN_TIME_BETWEEN_FORCED_SCANS, MIN_TIME_BETWEEN_SCANS, @@ -1378,9 +1377,7 @@ async def async_send_dropin_notification(self, message, **kwargs): ) @_catch_login_errors - async def async_play_tts_cloud_say( - self, media_type, public_url, media_id, **kwargs - ): + async def async_play_tts_cloud_say(self, public_url, media_id, **kwargs): file_name = media_id if media_source.is_media_source_id(media_id): media = await media_source.async_resolve_media( @@ -1389,12 +1386,6 @@ async def async_play_tts_cloud_say( file_name = media.url[media.url.rindex("/") : media.url.rindex(".")] media_id = async_process_play_media_url(self.hass, media.url) - if media_type == "music": - # Log and notify for Amazon restriction on streaming music - _LOGGER.warning(STREAMING_ERROR_MESSAGE) - await self.async_send_tts(STREAMING_ERROR_MESSAGE) - return - if kwargs.get(ATTR_MEDIA_ANNOUNCE): input_file_path = self.hass.config.path( f"{UPLOAD_PATH}{file_name}_input.mp3" @@ -1441,8 +1432,8 @@ async def async_play_tts_cloud_say( f"