token获取正常,但是PhicommDC1.py有报错:
2018-06-16 02:03:55 ERROR (MainThread) [homeassistant.helpers.entity] Update for switch.dc1 fails
Traceback (most recent call last):
File "/home/pi/homeassistant/lib/python3.5/site-packages/homeassistant/helpers/entity.py", line 204, in async_update_ha_state
yield from self.async_device_update()
File "/home/pi/homeassistant/lib/python3.5/site-packages/homeassistant/helpers/entity.py", line 327, in async_device_update
yield from self.hass.async_add_job(self.update)
File "/usr/lib/python3.5/asyncio/futures.py", line 380, in __iter__
yield self # This tells Task to wait for completion.
File "/usr/lib/python3.5/asyncio/tasks.py", line 304, in _wakeup
future.result()
File "/usr/lib/python3.5/asyncio/futures.py", line 293, in result
raise self._exception
File "/usr/lib/python3.5/concurrent/futures/thread.py", line 55, in run
result = self.fn(*self.args, **self.kwargs)
File "/home/pi/.homeassistant/custom_components/switch/PhicommDC1.py", line 310, in update
resp = requests.get('https://smartplug.phicomm.com/SmartPlugAppV1/plug/'+self._state_attrs[ATTR_DEVICEID]+'/online',headers=headers,timeout=3)
TypeError: Can't convert 'NoneType' object to str implicitly
|