Skip to content
New issue

Have a question about this project? # for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “#”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? # to your account

Home Assistant 0.117.1 一直报错。。 Error: Custom element not found: hf_weather-card #14

Open
mildrabbit opened this issue Nov 4, 2020 · 0 comments

Comments

@mildrabbit
Copy link

mildrabbit commented Nov 4, 2020

资源目录如下:
/custom_components/hf_weather
├── hf_weather
│   ├── init.py
│   ├── manifest.json
│   ├── pycache
│   │   ├── heweather_forecast.cpython-36.pyc
│   │   ├── init.cpython-37.pyc
│   │   ├── init.cpython-38.pyc
│   │   ├── weather.cpython-37.pyc
│   │   └── weather.cpython-38.pyc
│   └── weather.py

/www/hf_weather-card
├── hf_weather-card
│   ├── hf_weather-card.js
│   ├── hf_weather-card_new.js
│   ├── hf_weather-more-info.js
│   └── icons
│   ├── animated
│   │   ├── cloudy-day-1.svg
│   │   ├── cloudy-day-2.svg
│   │   ├── cloudy-day-3.svg
│   │   ├── cloudy-night-1.svg
│   │   ├── cloudy-night-2.svg
│   │   ├── cloudy-night-3.svg
│   │   ├── cloudy.svg
│   │   ├── day.svg
│   │   ├── night.svg
│   │   ├── rainy-1.svg
│   │   ├── rainy-2.svg
│   │   ├── rainy-3.svg
│   │   ├── rainy-4.svg
│   │   ├── rainy-5.svg
│   │   ├── rainy-6.svg
│   │   ├── rainy-7.svg
│   │   ├── snowy-1.svg
│   │   ├── snowy-2.svg
│   │   ├── snowy-3.svg
│   │   ├── snowy-4.svg
│   │   ├── snowy-5.svg
│   │   ├── snowy-6.svg
│   │   ├── thunder.svg
│   │   ├── weather_sagittarius.svg
│   │   ├── weather-sprite.svg
│   │   ├── weather_sunset.svg
│   │   └── weather.svg
│   ├── README.md
│   └── static
│   ├── cloudy-day-1.svg
│   ├── cloudy-day-2.svg
│   ├── cloudy-day-3.svg
│   ├── cloudy-night-1.svg
│   ├── cloudy-night-2.svg
│   ├── cloudy-night-3.svg
│   ├── cloudy.svg
│   ├── day.svg
│   ├── night.svg
│   ├── rainy-1.svg
│   ├── rainy-2.svg
│   ├── rainy-3.svg
│   ├── rainy-4.svg
│   ├── rainy-5.svg
│   ├── rainy-6.svg
│   ├── rainy-7.svg
│   ├── snowy-1.svg
│   ├── snowy-2.svg
│   ├── snowy-3.svg
│   ├── snowy-4.svg
│   ├── snowy-5.svg
│   ├── snowy-6.svg
│   ├── thunder.svg
│   ├── weather_sagittarius.svg
│   ├── weather-sprite.svg
│   ├── weather_sunset.svg
│   └── weather.svg

/config/configuration.yaml 配置文件的配置如下:

weather:

  • platform: hf_weather
    name: test # 必填,自定义实体名称,生成实体的entityId为weather.{{test}},后续配置需要用到
    city: 101040100 # 必填,城市代码,支持城市中英文名称、ID和IP地址,例如city=北京,city=beijing,
    appkey: # 必填,京东万象api平台申请的key

lovelace:
resources:
- url: /local/hf_weather-card/hf_weather-card.js
type: module
- url: /local/hf_weather-card/hf_weather-more-info.js
type: module

卡片手动模式创建,配置文件如下:
type: 'custom:hf_weather-card' # card类型
entity: weather.test # 天气插件生成实体的entityId
mode: daily
title: 天气 # 标题,不设置则使用entity的friendly_name
icons: /local/hf_weather-card/icons/animated/

系统 日志有一个报错。。

File "/usr/src/homeassistant/homeassistant/config_entries.py", line 234, in async_setup,
self._temperature = float(all_result["now"]["tmp"]),
File "/config/custom_components/hf_weather/weather.py", line 384, in async_update,
yield from data.async_update(dt_util.now()),
File "/config/custom_components/hf_weather/weather.py", line 86, in async_setup_platform,
File "/usr/src/homeassistant/homeassistant/helpers/entity_platform.py", line 197, in _async_setup_platform,
await asyncio.shield(task),

报错: Error: Custom element not found: hf_weather-card
请指导 下错误 在哪里。。。感谢。

# for free to join this conversation on GitHub. Already have an account? # to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

1 participant