Skip to content

v0.1.16:修复重载清理与重复状态上报

Choose a tag to compare

@bemfa bemfa released this 26 Oct 06:55
803d030

更新说明

修复

  • 配置重载与资源清理:改用 Home Assistant 标准重载流程,卸载时清理旧实例的监听器、TCP 连接、启动恢复及待执行任务;启动失败或取消时同样清理资源。
  • 状态上报去重:按 topic 比较实际发送内容,合并短时间连续变化并限制最长等待时间。发送失败不更新去重记录,首次连接及重连后重新同步设备状态。
  • 控制反馈合并:每个 topic 最多保留一个反馈调度任务,与状态事件共用去重逻辑,依据 HA 实际状态生成反馈,避免旧控制参数覆盖新状态。设备控制仍按原有语义逐条处理。

验证

新增 13 项离线回归测试并接入 GitHub CI,覆盖连续与并发重载、启动失败及取消清理、状态去重、反馈合并、卸载后停止反馈和本地 TCP 重连。生产 HA 环境仍需实际验收。

本次修复不能用于认定凌晨 HTTP mode=0 请求的来源。

相关变更:#34


Release notes (English)

  • Use Home Assistant's standard reload flow and clean up listeners, TCP connections, restore work, and pending tasks on unload, failed setup, or cancelled setup.
  • Deduplicate published payloads per topic, coalesce rapid state changes with a bounded delay, and resynchronize device states after reconnecting. Failed sends do not update the cache.
  • Merge feedback scheduling per topic and report actual HA state without overlaying stale control parameters. Individual device commands retain their existing behavior.
  • Add 13 offline regression tests to CI. Production HA acceptance testing is still needed.