添加失败
Closed this issue · 1 comments
Logger: homeassistant.components.weather
Source: custom_components/qweather/weather.py:263
Integration: Weather (documentation, issues)
First occurred: 17:54:32 (2 occurrences)
Last logged: 17:54:32
Error adding entities for domain weather with platform qweather
Error while setting up qweather platform for weather
Traceback (most recent call last):
File "/usr/src/homeassistant/homeassistant/helpers/entity_platform.py", line 382, in async_add_entities
await asyncio.gather(*tasks)
File "/usr/src/homeassistant/homeassistant/helpers/entity_platform.py", line 619, in _async_add_entity
await entity.add_to_platform_finish()
File "/usr/src/homeassistant/homeassistant/helpers/entity.py", line 810, in add_to_platform_finish
self.async_write_ha_state()
File "/usr/src/homeassistant/homeassistant/helpers/entity.py", line 533, in async_write_ha_state
self._async_write_ha_state()
File "/usr/src/homeassistant/homeassistant/helpers/entity.py", line 573, in _async_write_ha_state
attr.update(self.state_attributes or {})
File "/config/custom_components/qweather/weather.py", line 234, in state_attributes
data = super(QWeather, self).state_attributes
File "/usr/src/homeassistant/homeassistant/components/weather/init.py", line 249, in state_attributes
if self.forecast is not None:
File "/config/custom_components/qweather/weather.py", line 263, in forecast
for daily in self._daily_data:
TypeError: 'NoneType' object is not iterable
环境为:
Home Assistant Core 2022.6.7
Home Assistant Supervisor 2022.05.3
Home Assistant OS 8.2
配置文件:
weather:
- platform: qweather
name: hefeng
api_key: ************
location: 126.56,45.81
default: 7
查看一下个人的key是否是开发者key,现在因为添加了一些接口必须是开发者才可以使用。