|
@@ -34,8 +34,7 @@ STATUS_MAP = {
|
|
|
"reasoning": "thinking",
|
|
"reasoning": "thinking",
|
|
|
"using_tool": "ai",
|
|
"using_tool": "ai",
|
|
|
"running": "ai",
|
|
"running": "ai",
|
|
|
- "completed": "success",
|
|
|
|
|
- "session_completed": "success",
|
|
|
|
|
|
|
+ # "completed" 和 "session_completed" 跳动太快,不发送到灯
|
|
|
"permission": "alarm",
|
|
"permission": "alarm",
|
|
|
"error": "error"
|
|
"error": "error"
|
|
|
}
|
|
}
|
|
@@ -67,7 +66,9 @@ async def run_relay(device_name: str, service_uuid: str, char_uuid: str):
|
|
|
|
|
|
|
|
data = json.loads(line)
|
|
data = json.loads(line)
|
|
|
code = data.get("code", "idle")
|
|
code = data.get("code", "idle")
|
|
|
- mode = STATUS_MAP.get(code, "idle")
|
|
|
|
|
|
|
+ mode = STATUS_MAP.get(code)
|
|
|
|
|
+ if mode is None:
|
|
|
|
|
+ continue
|
|
|
|
|
|
|
|
await client.write_gatt_char(char_uuid, mode.encode("utf-8"))
|
|
await client.write_gatt_char(char_uuid, mode.encode("utf-8"))
|
|
|
logger.info(f"Sent: {mode} (from code: {code})")
|
|
logger.info(f"Sent: {mode} (from code: {code})")
|