『瀚思彼岸』» 智能家居技术论坛

标题: 在loveplace里,type: 'custom : color-lite-card',这个问题该怎么处理 [打印本页]

作者: ttt105    时间: 2021-1-13 16:39
标题: 在loveplace里,type: 'custom : color-lite-card',这个问题该怎么处理
今天在看https://github.com/bradcrc/color-lite-card/tree/master/tutorial/Lesson-2-Room,这个案例的时候,
打算把color-lite-card.js,这个文件挂在LOVEPLACE里,可以是一直报错,想和各位请教一下怎么处理,
我是小白一名,请大神们给指指路


                               
登录/注册后可看大图


[attach]27147[/attach]

[attach]27148[/attach]

作者: neroxps    时间: 2021-1-13 17:27
Unknown type encountered: custom : color-lite card


作者: netsnake    时间: 2021-1-13 17:32
本帖最后由 netsnake 于 2021-1-13 17:35 编辑

需要先安装color-lite card吧?!



作者: ttt105    时间: 2021-1-14 08:53
本帖最后由 ttt105 于 2021-1-14 08:54 编辑
netsnake 发表于 2021-1-13 17:32
需要先安装color-lite card吧?!

JS文件是按项目说明给传到指定目录的,并且是按步骤一步步的做的,
就是到 type : custom : color-lite card这里出错,请大家帮忙给分析一下

                               
登录/注册后可看大图



作者: netsnake    时间: 2021-1-14 16:12
3.Add the following line to the resources area near the top of your ui-lovelace.yaml
        resources:  - url: /local/js/color-lite-card.js
        type: js

作者: ttt105    时间: 2021-1-14 17:38
netsnake 发表于 2021-1-14 16:12
3.Add the following line to the resources area near the top of your ui-lovelace.yaml
        resourc ...

这两块内容都已经添进去了,
中间的内容用的实例中的,就是改了一下灯的名称
很奇怪,今天看了一天的官方文档也没有找到问题所在。

[attach]27165[/attach]
[attach]27166[/attach]



作者: ttt105    时间: 2021-1-15 17:30
本帖最后由 ttt105 于 2021-1-15 17:39 编辑

找到问题了,需要把'custom : color-lite-card'这个里面的空格全部去掉
请大家参考!

看来实例中的代码,还不能简单的复制粘贴,还是得检查一下代码质量

  1.   - type: 'custom:color-lite-card'
  2.     entity: light.fastled_ws2811_light
  3.     tap_action:
  4.       action: none
  5.     image: /local/tutorial/office.png
  6.     style:
  7.       top: 50%
  8.       left: 50%
  9.       width: 100%
复制代码





欢迎光临 『瀚思彼岸』» 智能家居技术论坛 (https://bbs.hassbian.com/) Powered by Discuz! X3.5