You need to sign in or sign up before continuing.
2 issues: why is python-yeelight saving state to bulb and UnboundLocalError
Hello. I am using the project with the home assistant platform and https://github.com/rytilahti/home-assistant/blob/yeelightng/homeassistant/components/light/yeelight.py.
The problem is that I am receiving an UnboundLocalError: local variable 'data' referenced before assignment
error together with some basic brightness+color change requests.
Also, how can I disable the "saving state to bulb" feature? I find it inconvenient. I would like the bulbs to reset to a standard white bright color when I switch them off/on using the wall switch (in case of problems and I don't have the time to fix it, or I don't have my phone nearby).
The log is below:
17-01-13 22:15:05 homeassistant.core: Error doing job: Task exception was never retrieved
Traceback (most recent call last):
File "/usr/lib/python3.4/asyncio/tasks.py", line 233, in _step
result = coro.throw(exc)
File "/srv/homeassistant/homeassistant_venv/lib/python3.4/site-packages/homeassistant/helpers/entity_component.py", line 386, in _update_entity_states
yield from update_coro
File "/srv/homeassistant/homeassistant_venv/lib/python3.4/site-packages/homeassistant/helpers/entity.py", line 216, in async_update_ha_state
yield from self.hass.loop.run_in_executor(None, self.update)
File "/usr/lib/python3.4/asyncio/futures.py", line 388, in __iter__
yield self # This tells Task to wait for completion.
File "/usr/lib/python3.4/asyncio/tasks.py", line 286, in _wakeup
value = future.result()
File "/usr/lib/python3.4/asyncio/futures.py", line 277, in result
raise self._exception
File "/usr/lib/python3.4/concurrent/futures/thread.py", line 54, in run
result = self.fn(*self.args, **self.kwargs)
File "/srv/homeassistant/homeassistant_venv/lib/python3.4/site-packages/homeassistant/components/light/yeelight.py", line 157, in update
self._bulb.get_properties()
File "/home/homeassistant/.homeassistant/deps/yeelight/main.py", line 158, in get_properties
response = self.send_command("get_prop", requested_properties)
File "/home/homeassistant/.homeassistant/deps/yeelight/main.py", line 206, in send_command
for line in data.split(b"\r\n"):
UnboundLocalError: local variable 'data' referenced before assignment