更新版本号至 0.0.8,完善 Home Assistant 控制指令描述,添加指令接收日志

This commit is contained in:
2026-01-31 16:31:31 +08:00
parent d17efcc606
commit 85eb4ff4f3
3 changed files with 10 additions and 9 deletions

View File

@@ -62,10 +62,11 @@ export const callText = async (text: string): Promise<CallHaReult> => {
app.route({
path: 'ha',
key: 'ha-call',
description: 'Home Assistant 控制指令',
description: 'Home Assistant 控制指令, 参数为 text 例如 打开 阳台灯',
}).define(async (ctx) => {
const text = ctx.query?.text || ''
console.log('收到指令:', text);
if (!text) {
ctx.throw(400, '缺少 text 参数');
}