feat(notifier): route TTS to tablet when TABLET_TTS_ENABLED

When TABLET_URL and VOICE_API_KEY are set, the tablet handles TTS
via its ElevenLabs proxy — local speak() is skipped. Controlled
by TABLET_TTS_ENABLED (default true when tablet is configured).

- notifier.speak_locally() — gate used by all local speech paths
- llm._maybe_speak — no-op when tablet plays the voice
- modes._handle_reset — emits response event and skips local speak
  when tablet TTS is on; keeps spoken fallback otherwise

Tablet side in smart-home-tablet repo: /api/voice/tts endpoint +
VoiceOverlay audio playback (commit ba2e… pending).

Co-Authored-By: Claude Opus 4.7 (1M context) <noreply@anthropic.com>
This commit is contained in:
Cosmo
2026-04-23 12:52:34 +00:00
parent e4e7529063
commit 584e21923c
4 changed files with 26 additions and 3 deletions

View File

@@ -34,7 +34,10 @@ def _handle_reset(text: str, agent_id: str) -> bool:
msg = "Начинаю новую сессию."
print(f"🔄 {msg}")
speak(msg, agent_id)
# Отправляем как response event — tablet зачитает, локально говорим только если TTS на этой машине.
notifier.response(msg, agent_id)
if notifier.speak_locally():
speak(msg, agent_id)
return True