Compare commits

...

5 commits

Author SHA1 Message Date
dependabot[bot]
d374605c87
Merge 5fd5ed5772 into 4b1a54a41c 2026-11-10 09:56:43 +08:00
wengzh
4b1a54a41c
Merge pull request #3545 from xinnan-tech/py-ha-state
Some checks failed
Tests / Java (manager-api) (push) Failing after 2m31s
Tests / Vue (manager-web) (push) Successful in 3m34s
Tests / Python (xiaozhi-server) (push) Successful in 30m21s
Py ha state
2026-11-09 14:43:00 +08:00
Sakura-RanChen
dd367c9e43 补充调整 2026-11-05 16:35:18 +08:00
Bao1573
b4e144afef
fix(hass): hass_get_state 的亮度按百分比报 (#3542)
HA 的 brightness 量程是 0~255,原样交给模型会被念成"一百五十三";灯关着时是 null,还会报"亮度是:None"。换算成百分比,和设置亮度用的 brightness_pct 同一个单位,开着的灯最低报 1%(同 HA 前端);不是数字时不报这一项。附测试。
2026-11-05 16:07:40 +08:00
dependabot[bot]
5fd5ed5772
Bump the ai-services group across 1 directory with 4 updates
Updates the requirements on [openai](https://github.com/openai/openai-python), [powermem](https://github.com/oceanbase/powermem), [dashscope](https://dashscope.aliyun.com/) and [markitdown](https://github.com/microsoft/markitdown) to permit the latest version.

Updates `openai` from 2.8.1 to 3.41.0
- [Release notes](https://github.com/openai/openai-python/releases)
- [Changelog](https://github.com/openai/openai-python/blob/main/CHANGELOG.md)
- [Commits](https://github.com/openai/openai-python/compare/v2.8.1...v3.41.0)

Updates `powermem` to 1.1.7
- [Release notes](https://github.com/oceanbase/powermem/releases)
- [Commits](https://github.com/oceanbase/powermem/compare/v0.3.1...v1.1.7)

Updates `dashscope` from 1.27.7 to 2.0.2

Updates `markitdown` from 0.1.8 to 0.1.9
- [Release notes](https://github.com/microsoft/markitdown/releases)
- [Commits](https://github.com/microsoft/markitdown/compare/v0.1.8...v0.1.9)

---
updated-dependencies:
- dependency-name: openai
  dependency-version: 3.41.0
  dependency-type: direct:production
  update-type: version-update:semver-major
  dependency-group: ai-services
- dependency-name: powermem
  dependency-version: 1.1.7
  dependency-type: direct:production
  dependency-group: ai-services
- dependency-name: dashscope
  dependency-version: 2.0.2
  dependency-type: direct:production
  update-type: version-update:semver-major
  dependency-group: ai-services
- dependency-name: markitdown
  dependency-version: 0.1.9
  dependency-type: direct:production
  update-type: version-update:semver-patch
  dependency-group: ai-services
...

Signed-off-by: dependabot[bot] <support@github.com>
2026-11-01 08:45:36 +00:00
2 changed files with 13 additions and 18 deletions

View file

@ -121,13 +121,10 @@ async def handle_hass_get_state(conn: "ConnectionHandler", entity_id):
+ str(response.json()["attributes"]["media_title"])
+ " "
)
if "volume_level" in response.json()["attributes"]:
responsetext = (
responsetext
+ "音量是:"
+ str(response.json()["attributes"]["volume_level"])
+ " "
)
volume_level = response.json()["attributes"].get("volume_level")
if isinstance(volume_level, (int, float)):
# volume_level 量程 0~1,换算成百分比(同 volume_set 的 1~100)
responsetext = responsetext + "音量是:" + f"{round(volume_level * 100)}%" + " "
if "color_temp_kelvin" in response.json()["attributes"]:
responsetext = (
responsetext
@ -142,13 +139,11 @@ async def handle_hass_get_state(conn: "ConnectionHandler", entity_id):
+ str(response.json()["attributes"]["rgb_color"])
+ " "
)
if "brightness" in response.json()["attributes"]:
responsetext = (
responsetext
+ "亮度是:"
+ str(response.json()["attributes"]["brightness"])
+ " "
)
brightness = response.json()["attributes"].get("brightness")
if isinstance(brightness, (int, float)):
# brightness 量程 0~255,换算成百分比(同 brightness_pct 的 1~100),开灯最低报 1%
percent = max(1, round(brightness * 100 / 255)) if brightness > 0 else 0
responsetext = responsetext + "亮度是:" + f"{percent}%" + " "
logger.bind(tag=TAG).info(f"查询返回内容: {responsetext}")
return responsetext
else:

View file

@ -13,7 +13,7 @@ pydub==0.25.1
funasr==1.4.16
# transformers>=5 要求 torch>=2.6,与本项目 torch 2.2.2 冲突(会禁用 PyTorch,fun_local 加载不了模型)
transformers<5
openai==2.8.1
openai==3.41.0
google-generativeai==0.8.6
edge_tts==7.3.1
httpx==0.28.1
@ -25,17 +25,17 @@ loguru==0.7.3
requests==2.34.2
cozepy==0.20.0
mem0ai==2.2.1
powermem>=0.3.1
powermem>=1.1.7
bs4==0.0.2
modelscope==1.40.2
sherpa_onnx==1.13.8
mcp==2.3.0
cnlunar==0.2.5
PySocks==1.7.1
dashscope==1.27.7
dashscope==2.0.2
baidu-aip==4.16.13
aioconsole==0.8.2
markitdown==0.1.8
markitdown==0.1.9
mcp-proxy==0.12.0
PyJWT==2.15.1
psutil==7.2.2