2019年1月5日16:15---------------------------------------------------------------------------------------------------------------------------
发现“系统提示:Platform not found: sensor.attributes”的问题所在,是custom_components/sensor/attributes.py的问题
from homeassistant.helpers.restore_state import async_get_last_state
错误提示:
Error doing job: Task exception was never retrieved
Traceback (most recent call last):
File "/usr/lib/python3.5/asyncio/tasks.py", line 239, in _step
result = coro.send(None)
File "/usr/local/lib/python3.5/dist-packages/homeassistant/helpers/entity_platform.py", line 350, in _async_add_entity
await entity.async_added_to_hass()
File "/home/pi/.homeassistant/custom_components/sensor/attributes.py", line 170, in async_added_to_hass
state = yield from async_get_last_state(self.hass, self.entity_id)
NameError: name 'async_get_last_state' is not defined
--------------------------------------------------------------------------------------------------------------------------------------------------
系统提示:Platform not found: sensor.attributes