mirror of
https://github.com/xinnan-tech/xiaozhi-esp32-server.git
synced 2026-07-30 05:13:59 +08:00
refactor: 合并 HA 设备控制插件为 hass_state 模块
This commit is contained in:
@@ -16,7 +16,7 @@ def append_devices_to_prompt(conn):
|
||||
config_source = (
|
||||
"home_assistant"
|
||||
if plugins_config.get("home_assistant")
|
||||
else "hass_get_state"
|
||||
else "hass_state"
|
||||
)
|
||||
|
||||
if "hass_get_state" in funcs or "hass_set_state" in funcs:
|
||||
@@ -36,7 +36,7 @@ def initialize_hass_handler(conn):
|
||||
plugins_config = conn.config.get("plugins", {})
|
||||
# 确定配置来源
|
||||
config_source = (
|
||||
"home_assistant" if plugins_config.get("home_assistant") else "hass_get_state"
|
||||
"home_assistant" if plugins_config.get("home_assistant") else "hass_state"
|
||||
)
|
||||
if not plugins_config.get(config_source):
|
||||
return ha_config
|
||||
|
||||
Reference in New Issue
Block a user