Skip to content

feat(ai-components): language-neutral alert tones + guided WeChat UI fixes - #713

Merged
yingtao450 merged 3 commits into
tuya:masterfrom
jianning773:feature/ai-alert-tone
Sep 23, 2026
Merged

yingtao450 merged 3 commits into
tuya:masterfrom
jianning773:feature/ai-alert-tone

Conversation

@jianning773

Copy link
Copy Markdown
Contributor

Summary

Three changes for the AI components, verified end-to-end on TUYA_T5AI_BOARD.

1. Language-neutral local alert tones (ENABLE_AI_ALERT_TONE)

  • New Kconfig option under ai_components (default y): all local alerts
    play short language-neutral tones (success / wait / fail / wake, ~15 KB of
    MP3 assets) instead of localized speech.
  • While enabled, the zh / en speech packs (~166 KB / ~174 KB of MP3 arrays)
    are excluded from the build entirely. Sources are kept; set
    ENABLE_AI_ALERT_TONE=n to restore the voice prompts.
  • No runtime logic changes — only asset mapping in media_src.h and compile
    guards on the speech pack sources.

2. Fix 1 Hz KV re-read in guided WeChat state

  • The guided network page refreshes its state snapshot at 1 Hz and re-read
    the stored uuid/authkey from KV flash on every tick (one flash read plus
    an "Authorization read succeeds." log line per second).
  • The storage license has no writer after boot, so it is now read once and
    cached (the authorize module returns pointers to persistent buffers).

3. Show SoftAP hotspot name during pairing

  • While netcfg is running, the BLE and AP transports work in parallel. The
    guided network page now shows the live hotspot name
    ("配网热点:SmartLife-XXXX" / "Setup hotspot: ...") under the guide QR,
    giving app-less phones a path to the captive setup page.
  • ap_netcfg stores the hotspot ssid/ip when the SoftAP starts and exposes
    a read-only getter; the UI reads it from the existing 1 Hz state snapshot
    (RAM copy only, no extra IO).

Notes for reviewers

  • ENABLE_AI_ALERT_TONE=y changes the default alert behavior from localized
    speech to tones. Projects that need voice prompts can set it to n; the
    zh / en packs then build again unchanged.
  • Verified by build + symbol inspection (with tones on, the speech objects
    compile to empty stubs) and on-device smoke tests, including an app with
    no explicit language / tone config lines.

🤖 Generated with Claude Code


jianning773 and others added 3 commits September 21, 2026 16:04
… pack

Replace the localized voice prompts with short synthesized tones when
ENABLE_AI_ALERT_TONE is enabled (now the default):

- add 4 semantic tones (success / wait / fail / wake) as MP3 C arrays,
  generated from assets/media/tone_*.mp3
- map all local alert types onto the 4 tones in media_src.h
- compile out the zh/en speech packs while tones are enabled, keeping
  the sources in tree so voice prompts come back by disabling the option

The language option still drives on-screen text; only alert playback
changes. Set ENABLE_AI_ALERT_TONE=n to restore the speech packs.

Co-Authored-By: Claude Code <noreply@anthropic.com>
guided_wechat_state_read() runs from the 1 Hz UI refresh timer and called
tuya_authorize_read() on every invocation, re-reading uuid/authkey from
KV flash once per second and logging "Authorization read succeeds." at
the same rate.

The storage license never changes at runtime (no code path writes it
after boot and the UI offers no authorization reset), so read it once
and serve the cached pointers. The pointers target the authorize module
persistent buffers, which stay valid for the firmware lifetime.

Co-Authored-By: Claude Code <noreply@anthropic.com>
While pairing runs, BLE and AP netcfg operate in parallel. Surface the
live AP hotspot name under the guide QR so an app-less phone can join
the hotspot and reach the captive setup page.

- ap_netcfg: store hotspot ssid/ip when the SoftAP starts and expose a
  read-only getter
- guided wechat state: carry ap_ssid/ap_ip in the device state snapshot
- guided wechat UI: one muted hint line under the QR
  ("配网热点:<ssid>" / "Setup hotspot: <ssid>"), only while pairing is
  live and the hotspot is up

Co-Authored-By: Claude Code <noreply@anthropic.com>
@yingtao450
yingtao450 merged commit 5e9b27b into tuya:master Sep 23, 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.

2 participants