Skip to content

v1.10.4#288

Merged
TiTidom-RC merged 8 commits into
mainfrom
beta
Jun 27, 2026
Merged

v1.10.4#288
TiTidom-RC merged 8 commits into
mainfrom
beta

Conversation

@TiTidom-RC

Copy link
Copy Markdown
Owner

This pull request introduces several improvements and fixes to the TTS Cast plugin, focusing on better handling of TTS file generation, improved error detection and logging, and dependency updates. The main changes include more robust handling of JeedomTTS and VoiceRSS responses, clearer error messages (now in French for consistency), and dependency bumps for Google TTS libraries.

TTS file handling and error detection:

  • Improved the jeedomTTS method to properly decode and validate file paths returned by Jeedom, handle missing dependencies (like pico/espeak), and log detailed errors if the TTS file is not found.
  • Enhanced the voiceRSS method to verify that responses are valid MP3 files by checking magic bytes, and to log warnings for invalid or unexpected responses.
  • Updated generateTestTTS and getTTS to return False and log an error if JeedomTTS does not generate an audio file, ensuring failures are detected and handled upstream. [1] [2]

Error logging and messaging:

  • Standardized and translated error/warning log messages to French for JeedomTTS, VoiceRSS, and Google Translate errors, improving consistency and clarity for French-speaking users. [1] [2] [3] [4] [5] [6] [7] [8] [9]

Dependency and configuration updates:

  • Bumped google-cloud-texttospeech to 2.37.0 and google-genai to 2.9.0 in requirements.txt for improved compatibility and features.
  • Updated .vscode/settings.json to add "espeak" and "pico" to the list of excluded files, reflecting the supported TTS engines. [1] [2]
  • Bumped plugin version to 1.10.4 in plugin_info/info.json.

These changes make the TTS generation process more robust, improve diagnostics, and ensure the plugin is up-to-date with its dependencies.

Handle Jeedom tts.php responses that return a file path: decode and strip response content, verify path with os.path.exists, and read file with a context manager. Replace several English log messages with French equivalents for consistency and improve debug formatting (use %d for length). Add missing "espeak" and "pico" entries to VSCode settings and bump plugin version to 1.10.3 in plugin_info.
Check HTTP response content from VoiceRSS for MP3 magic bytes before using it. The code now verifies status code and that response.content starts with ID3 or an MPEG sync frame (0xFF 0xE0+); if not, it logs a warning (showing up to 80 chars of the response) and avoids treating the payload as audio. Assigns filecontent only when valid and removes the previous unused/incorrect handling. This prevents non-MP3 API errors or HTML responses from being processed as audio.
Bump dependency versions in resources/requirements.txt: google-cloud-texttospeech 2.36.0 -> 2.37.0 and google-genai 2.8.0 -> 2.9.0. These upgrades bring minor fixes and improvements from the newer releases.
Upgrade JeedomTTS failure paths from warnings to errors in the daemon, including HTTP status failures and missing TTS files. Also make `TestTTS` and main `TTS` processing return `False` immediately when JeedomTTS output is invalid, so bad responses no longer continue as if successful.
Updates two error logs in `ttscastd.py` (`TestTTS` and `TTS`) to report that no audio file was generated, instead of the vaguer "incorrect output" message. This makes failure diagnostics more explicit when JeedomTTS returns no usable audio payload.
Updates plugin metadata to version 1.10.4 and adjusts Jeedom TTS daemon log messages to explicitly label Jeedom file paths/errors. This makes troubleshooting missing generated TTS files clearer in mixed TTS contexts.
@TiTidom-RC
TiTidom-RC merged commit 6f3de84 into main Jun 27, 2026
1 check passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant