impressionyang
|
23f671fa62
|
fix: 修复 Lovelace 卡片加载错误
问题:Custom element not found: sigmesh-gateway-panel
修复内容:
1. sigmesh-gateway-panel.js:
- 添加 window.customCards 注册
- 添加卡片元数据(name, description, preview)
- 更新使用说明
2. hacs.json:
- 添加 frontend.extra_module_url 配置
- 添加 category: integration
3. 新增 deploy.sh 部署脚本:
- 自动复制集成文件和 Lovelace 卡片
- 设置正确权限
- 提示用户配置 frontend
4. README.md:
- 添加部署脚本使用说明
- 添加常见问题排查(卡片加载错误)
- 区分手动部署和 HACS 安装两种方式
部署步骤:
1. chmod +x deploy.sh && ./deploy.sh
2. 在 configuration.yaml 添加 frontend.extra_module_url
3. ha core restart
4. 清除浏览器缓存后添加卡片
|
2026-04-16 14:26:00 +08:00 |
|
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 |
|