From 8a2fe7c20e163958cbbf57ac3a65084a2e2deb0b Mon Sep 17 00:00:00 2001 From: hrz <1710360675@qq.com> Date: Fri, 13 Jun 2025 09:24:13 +0800 Subject: [PATCH] =?UTF-8?q?update:=E8=AE=BE=E5=A4=87=E5=88=97=E8=A1=A8?= =?UTF-8?q?=E4=BC=98=E5=8C=96?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- main/xiaozhi-server/plugins_func/functions/hass_init.py | 9 ++------- 1 file changed, 2 insertions(+), 7 deletions(-) diff --git a/main/xiaozhi-server/plugins_func/functions/hass_init.py b/main/xiaozhi-server/plugins_func/functions/hass_init.py index 4e8660c9..11cbb7a0 100644 --- a/main/xiaozhi-server/plugins_func/functions/hass_init.py +++ b/main/xiaozhi-server/plugins_func/functions/hass_init.py @@ -19,13 +19,8 @@ def append_devices_to_prompt(conn): if "hass_get_state" in funcs or "hass_set_state" in funcs: prompt = "\n下面是我家智能设备列表(位置,设备名,entity_id),可以通过homeassistant控制\n" - # TODO 分割被控设备 - devices = conn.config["plugins"].get(config_source, {}).get("devices", []) - if len(devices) == 0: - return - for device in devices: - prompt += device + "\n" - conn.prompt += prompt + deviceStr = conn.config["plugins"].get(config_source, {}).get("devices", "") + conn.prompt += prompt + deviceStr + "\n" # 更新提示词 conn.dialogue.update_system_message(conn.prompt)