mirror of
https://github.com/xinnan-tech/xiaozhi-esp32-server.git
synced 2026-11-29 05:09:46 +01:00
Compare commits
5 commits
eb193ac23e
...
c661264753
| Author | SHA1 | Date | |
|---|---|---|---|
|
|
c661264753 | ||
|
|
4b1a54a41c | ||
|
|
dd367c9e43 | ||
|
|
b4e144afef | ||
|
|
87de6ea39c |
2 changed files with 14 additions and 19 deletions
|
|
@ -121,13 +121,10 @@ async def handle_hass_get_state(conn: "ConnectionHandler", entity_id):
|
||||||
+ str(response.json()["attributes"]["media_title"])
|
+ str(response.json()["attributes"]["media_title"])
|
||||||
+ " "
|
+ " "
|
||||||
)
|
)
|
||||||
if "volume_level" in response.json()["attributes"]:
|
volume_level = response.json()["attributes"].get("volume_level")
|
||||||
responsetext = (
|
if isinstance(volume_level, (int, float)):
|
||||||
responsetext
|
# volume_level 量程 0~1,换算成百分比(同 volume_set 的 1~100)
|
||||||
+ "音量是:"
|
responsetext = responsetext + "音量是:" + f"{round(volume_level * 100)}%" + " "
|
||||||
+ str(response.json()["attributes"]["volume_level"])
|
|
||||||
+ " "
|
|
||||||
)
|
|
||||||
if "color_temp_kelvin" in response.json()["attributes"]:
|
if "color_temp_kelvin" in response.json()["attributes"]:
|
||||||
responsetext = (
|
responsetext = (
|
||||||
responsetext
|
responsetext
|
||||||
|
|
@ -142,13 +139,11 @@ async def handle_hass_get_state(conn: "ConnectionHandler", entity_id):
|
||||||
+ str(response.json()["attributes"]["rgb_color"])
|
+ str(response.json()["attributes"]["rgb_color"])
|
||||||
+ " "
|
+ " "
|
||||||
)
|
)
|
||||||
if "brightness" in response.json()["attributes"]:
|
brightness = response.json()["attributes"].get("brightness")
|
||||||
responsetext = (
|
if isinstance(brightness, (int, float)):
|
||||||
responsetext
|
# brightness 量程 0~255,换算成百分比(同 brightness_pct 的 1~100),开灯最低报 1%
|
||||||
+ "亮度是:"
|
percent = max(1, round(brightness * 100 / 255)) if brightness > 0 else 0
|
||||||
+ str(response.json()["attributes"]["brightness"])
|
responsetext = responsetext + "亮度是:" + f"{percent}%" + " "
|
||||||
+ " "
|
|
||||||
)
|
|
||||||
logger.bind(tag=TAG).info(f"查询返回内容: {responsetext}")
|
logger.bind(tag=TAG).info(f"查询返回内容: {responsetext}")
|
||||||
return responsetext
|
return responsetext
|
||||||
else:
|
else:
|
||||||
|
|
|
||||||
|
|
@ -12,15 +12,15 @@ opuslib_next==1.3.1
|
||||||
pydub==0.25.1
|
pydub==0.25.1
|
||||||
funasr==1.4.16
|
funasr==1.4.16
|
||||||
# transformers>=5 要求 torch>=2.6,与本项目 torch 2.2.2 冲突(会禁用 PyTorch,fun_local 加载不了模型)
|
# transformers>=5 要求 torch>=2.6,与本项目 torch 2.2.2 冲突(会禁用 PyTorch,fun_local 加载不了模型)
|
||||||
transformers<5
|
transformers<6
|
||||||
openai==2.8.1
|
openai==2.8.1
|
||||||
google-generativeai==0.8.6
|
google-generativeai==0.8.6
|
||||||
edge_tts==7.3.1
|
edge_tts==7.3.1
|
||||||
httpx==0.28.1
|
httpx==0.28.1
|
||||||
aiohttp==3.14.5
|
aiohttp==3.14.5
|
||||||
aiohttp_cors==0.8.1
|
aiohttp_cors==0.8.1
|
||||||
ormsgpack==1.12.2
|
ormsgpack==1.13.0
|
||||||
ruamel.yaml==0.18.16
|
ruamel.yaml==0.19.1
|
||||||
loguru==0.7.3
|
loguru==0.7.3
|
||||||
requests==2.34.2
|
requests==2.34.2
|
||||||
cozepy==0.20.0
|
cozepy==0.20.0
|
||||||
|
|
@ -28,7 +28,7 @@ mem0ai==2.2.1
|
||||||
powermem>=0.3.1
|
powermem>=0.3.1
|
||||||
bs4==0.0.2
|
bs4==0.0.2
|
||||||
modelscope==1.40.2
|
modelscope==1.40.2
|
||||||
sherpa_onnx==1.13.8
|
sherpa_onnx==2.0.1
|
||||||
mcp==2.3.0
|
mcp==2.3.0
|
||||||
cnlunar==0.2.5
|
cnlunar==0.2.5
|
||||||
PySocks==1.7.1
|
PySocks==1.7.1
|
||||||
|
|
@ -36,7 +36,7 @@ dashscope==1.27.7
|
||||||
baidu-aip==4.16.13
|
baidu-aip==4.16.13
|
||||||
aioconsole==0.8.2
|
aioconsole==0.8.2
|
||||||
markitdown==0.1.8
|
markitdown==0.1.8
|
||||||
mcp-proxy==0.12.0
|
mcp-proxy==0.13.0
|
||||||
PyJWT==2.15.1
|
PyJWT==2.15.1
|
||||||
psutil==7.2.2
|
psutil==7.2.2
|
||||||
portalocker==3.2.0 # 暂留 3.x:4.x 与 qdrant-client<1.20 的 portalocker<4.0 约束冲突 (PR #3360)
|
portalocker==3.2.0 # 暂留 3.x:4.x 与 qdrant-client<1.20 的 portalocker<4.0 约束冲突 (PR #3360)
|
||||||
|
|
|
||||||
Loading…
Reference in a new issue