mirror of
https://github.com/xinnan-tech/xiaozhi-esp32-server.git
synced 2026-11-26 04:39:53 +01:00
update:设备列表优化
This commit is contained in:
parent
0fc8f02c6e
commit
8a2fe7c20e
1 changed files with 2 additions and 7 deletions
|
|
@ -19,13 +19,8 @@ def append_devices_to_prompt(conn):
|
||||||
|
|
||||||
if "hass_get_state" in funcs or "hass_set_state" in funcs:
|
if "hass_get_state" in funcs or "hass_set_state" in funcs:
|
||||||
prompt = "\n下面是我家智能设备列表(位置,设备名,entity_id),可以通过homeassistant控制\n"
|
prompt = "\n下面是我家智能设备列表(位置,设备名,entity_id),可以通过homeassistant控制\n"
|
||||||
# TODO 分割被控设备
|
deviceStr = conn.config["plugins"].get(config_source, {}).get("devices", "")
|
||||||
devices = conn.config["plugins"].get(config_source, {}).get("devices", [])
|
conn.prompt += prompt + deviceStr + "\n"
|
||||||
if len(devices) == 0:
|
|
||||||
return
|
|
||||||
for device in devices:
|
|
||||||
prompt += device + "\n"
|
|
||||||
conn.prompt += prompt
|
|
||||||
# 更新提示词
|
# 更新提示词
|
||||||
conn.dialogue.update_system_message(conn.prompt)
|
conn.dialogue.update_system_message(conn.prompt)
|
||||||
|
|
||||||
|
|
|
||||||
Loading…
Reference in a new issue