feat: 添加编译时模块开关配置

通过 sdkconfig.defaults 选择性启用/禁用模块,减少固件体积:

新增模块开关:
- CONFIG_MIMI_CHAN_TELEGRAM (默认 n)
- CONFIG_MIMI_CHAN_FEISHU (默认 y)
- CONFIG_MIMI_TOOL_WEB_SEARCH (默认 y)
- CONFIG_MIMI_TOOL_GPIO (默认 n)
- CONFIG_MIMI_WS_SERVER (默认 y)
- CONFIG_MIMI_WIFI_ONBOARD (默认 y)
- CONFIG_MIMI_OTA (默认 n)

技术实现:
- CMakeLists.txt 条件编译源文件
- 头文件使用 static inline stub
- CLI 命令和工具注册也支持条件编译

消除 Telegram 未配置时的 5 秒轮询警告日志
This commit is contained in:
2026-04-03 20:15:26 +08:00
parent 540bfe825f
commit 6983a1f1ba
15 changed files with 455 additions and 154 deletions

View File

@@ -6,3 +6,23 @@ CONFIG_LWIP_LOCAL_HOSTNAME="mimiclaw"
# SPIFFS: increase max filename length (default 32 is too short for session files)
CONFIG_SPIFFS_OBJ_NAME_LEN=64
# ─── Channel Modules ──────────────────────────────────────────────
# Telegram bot integration (disable if using Feishu only)
CONFIG_MIMI_CHAN_TELEGRAM=n
# Feishu (Lark) bot integration (default: enabled)
CONFIG_MIMI_CHAN_FEISHU=y
# ─── Tool Modules ─────────────────────────────────────────────────
# Web search tool (requires search API key)
CONFIG_MIMI_TOOL_WEB_SEARCH=y
# GPIO control tool (for hardware control)
CONFIG_MIMI_TOOL_GPIO=n
# ─── Optional Modules ──────────────────────────────────────────────
# WebSocket gateway (for local clients)
CONFIG_MIMI_WS_SERVER=y
# WiFi onboarding portal (Captive Portal for initial setup)
CONFIG_MIMI_WIFI_ONBOARD=y
# OTA firmware update (not fully implemented)
CONFIG_MIMI_OTA=n