From 527b4f970e38972bfa6b61623c3c80513c198eae Mon Sep 17 00:00:00 2001 From: hrz <1710360675@qq.com> Date: Tue, 18 Mar 2025 13:15:51 +0800 Subject: [PATCH] =?UTF-8?q?fix=EF=BC=9A=E7=94=B5=E8=84=91=E4=B8=8D?= =?UTF-8?q?=E6=94=AF=E6=8C=81iot=E9=9F=B3=E9=87=8F=E6=8E=A7=E5=88=B6bug?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../plugins_func/functions/raise_and_lower_the_volume.py | 2 ++ 1 file changed, 2 insertions(+) diff --git a/main/xiaozhi-server/plugins_func/functions/raise_and_lower_the_volume.py b/main/xiaozhi-server/plugins_func/functions/raise_and_lower_the_volume.py index 2a5aa965d..c77cb78b4 100644 --- a/main/xiaozhi-server/plugins_func/functions/raise_and_lower_the_volume.py +++ b/main/xiaozhi-server/plugins_func/functions/raise_and_lower_the_volume.py @@ -49,6 +49,8 @@ def raise_and_lower_the_volume(conn, action: str): async def _raise_and_lower_the_volume(conn, action): volume = await get_iot_status(conn, "Speaker", "volume") + if volume is None: + raise Exception("你的设备不支持音量控制") if action == 'raise': volume += 10 elif action == 'lower':