From b87ebc6e1cbadc88bcba6e556551018137badb98 Mon Sep 17 00:00:00 2001 From: hrz <1710360675@qq.com> Date: Mon, 7 Apr 2025 22:10:07 +0800 Subject: [PATCH] =?UTF-8?q?update:=E8=AE=BE=E5=AE=9Aiot=E6=93=8D=E4=BD=9C?= =?UTF-8?q?=E9=BB=98=E8=AE=A4=E5=80=BC=20(#700)?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- main/xiaozhi-server/core/handle/iotHandle.py | 6 ++++++ 1 file changed, 6 insertions(+) diff --git a/main/xiaozhi-server/core/handle/iotHandle.py b/main/xiaozhi-server/core/handle/iotHandle.py index 26ea3864..76d8b4b7 100644 --- a/main/xiaozhi-server/core/handle/iotHandle.py +++ b/main/xiaozhi-server/core/handle/iotHandle.py @@ -50,6 +50,12 @@ def create_iot_function(device_name, method_name, method_info): conn, response_success=None, response_failure=None, **params ): try: + # 设置默认响应消息 + if not response_success: + response_success = "操作成功" + if not response_failure: + response_failure = "操作失败" + # 打印响应参数 logger.bind(tag=TAG).info( f"控制函数接收到的响应参数: success='{response_success}', failure='{response_failure}'"