Commit Graph

3 Commits

Author SHA1 Message Date
impressionyang
e140dd81c4 fix: 修复 Lovelace 卡片和过时常量警告
修复 1: Lovelace 卡片配置错误
- 重写 sigmesh-gateway-panel.js 遵循 HA 卡片规范
- 添加 setConfig 方法
- 添加 getCardSize 方法
- 添加静态方法 (getStubConfig, getConfigElement)
- 使用 ha-card 包装器和 shadow DOM
- 修复 hass 设置和渲染逻辑

修复 2: 过时常量警告
- light.py: 将 ATTR_COLOR_TEMP 替换为 ATTR_COLOR_TEMP_KELVIN
- 修复 HA Core 2026.1 兼容性警告

部署步骤:
1. cp custom_components/sigmesh_gateway/sigmesh-gateway-panel.js ~/.homeassistant/www/community/sigmesh_gateway/
2. cp -r custom_components/sigmesh_gateway ~/.homeassistant/custom_components/
3. ha core restart
2026-04-16 14:13:22 +08:00
impressionyang
311cfbbe7e fix: 修复平台文件和 OptionsFlow 错误
修复内容:
1. 所有平台文件添加 coordinator.data None 检查
   - sensor.py, binary_sensor.py, switch.py, light.py, device_tracker.py
2. 修复 async_get_options_flow 签名
   - 改为实例方法,移除 config_entry 参数
   - 移除 @staticmethod 装饰器
3. OptionsFlow 添加正确的 __init__ 方法

Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
2026-04-16 09:48:00 +08:00
impressionyang
19774a4a9f fix: 修复平台加载和 OptionsFlow 错误
主要修复:
1. 将平台文件从 platforms/ 移到集成根目录
   - sensor.py, binary_sensor.py, switch.py, light.py, device_tracker.py
2. 修复 OptionsFlow config_entry 属性错误
   - 移除手动设置的 config_entry
3. 添加集成图标 icons/icon.png
4. manifest.json 添加 integration_type: device

Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
2026-04-16 09:39:35 +08:00