fix: 修复空调设备无法控制及数据不同步问题 - #275
Open
youyusi wants to merge 1 commit into
Open
Conversation
核心修复: - entity.py: data_callback 添加 try/except 保护,_update_value() 异常不阻断 UI 更新 - 所有实体文件 (climate/water_heater/cover/number/sensor/select/switch/binary_sensor): _attributes_data 直接索引 [] 改为 .get() 安全访问,避免 KeyError 导致 UI 冻结 WebSocket 稳定性: - _parse_message/_process_digital_model 全方法异常保护,异常消息安全跳过不崩溃 - 消息循环外层 try/except,非连接性异常不影响网关运行 - ws_connect 添加 heartbeat=30s,快速检测半开连接 - control_callback 使用 .get() 防止二次 KeyError - connect() 追踪连续重连失败,Token 过期时主动 ERROR 告警 命令队列与设备刷新: - _drain_pending_commands 单个命令失败不再阻塞后续命令 - FORCE_REFRESH 新增 KFR- 前缀匹配,空调设备自动纳入 60s 强制轮询 API 客户端: - retry_on_exception 重写为指数退避 (1s/2s/4s),避免快速重试雪崩
Owner
|
感谢修复。当前 PR 包含多个独立问题的修改,请拆分成 case by case 的提交,并说明每个修改对应的问题背景、原因和目的,方便 review 和后续维护。 |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
核心修复:
WebSocket 稳定性:
命令队列与设备刷新:
API 客户端: