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

标题: 求教,新版插件目录更改后,原来老插件的修改方法RI [打印本页]

作者: s2233    时间: 2019-10-5 13:28
标题: 求教,新版插件目录更改后,原来老插件的修改方法RI
本帖最后由 s2233 于 2019-10-6 14:38 编辑

                      之前坛里照着大大们写的插件和详细教程,依葫芦画瓢照抄着也勉强用上了

                谁知0.9几后那次的插件目录更改,L大大的彩云SE , C大的博联插件等。。。好多插件都用不了

              那位能告诉下修改方法或者帖上文件,学习下

                 感谢!
C大插件
https://bbs.hassbian.com/thread-584-1-1.html

HA版本 0.99.3

插件目录 custom_components\broadlink_mp1\switch.py
                                                                           \manifest.json

manifest.json内容

{
  "domain": "broadlink_mp1",
  "name": "Broadlink",
  "documentation": "https://www.home-assistant.io/components/broadlink",
  "requirements": [],
  "dependencies": [],
  "codeowners": []
}


报错日志
Log Details (ERROR)Sun Oct 06 2019 14:28:15 GMT+0800 (中国标准时间)
Error while setting up platform broadlink_mp1Traceback (most recent call last):  File "/usr/src/homeassistant/homeassistant/helpers/entity_platform.py", line 150, in _async_setup_platform    await asyncio.wait_for(asyncio.shield(task), SLOW_SETUP_MAX_WAIT)  File "/usr/local/lib/python3.7/asyncio/tasks.py", line 442, in wait_for    return fut.result()  File "/usr/local/lib/python3.7/concurrent/futures/thread.py", line 57, in run    result = self.fn(*self.args, **self.kwargs)  File "/config/custom_components/broadlink_mp1/switch.py", line 74, in setup_platform    persistent_notification = loader.get_component(hass,'persistent_notification')AttributeError: module 'homeassistant.loader' has no attribute 'get_component'



作者: 情非殇    时间: 2019-10-5 18:59
搜 0.92 插件 或者 插件目录
作者: s2233    时间: 2019-10-6 14:39
情非殇 发表于 2019-10-5 18:59
搜 0.92 插件 或者 插件目录

照着改报错。。。  也不知哪里不对
作者: netsnake    时间: 2019-10-7 07:29
本帖最后由 netsnake 于 2019-10-7 07:33 编辑

File "/config/custom_components/broadlink_mp1/switch.py", line 74,

in setup_platform    persistent_notification = loader.get_component(hass,'persistent_notification')AttributeError: module 'homeassistant.loader' has no attribute 'get_component'



homeassistant.loader.get_component(hass, comp_or_platform: str) → Optional[module][source]
Try to load specified component.
Looks in config dir first, then built-in components. Only returns it if also found to be valid. Async friendly.






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