wmalgadey / tado_component

Custom home-assistant component for tado (using PyTado)
GNU General Public License v3.0
12 stars 1 forks source link

UnboundLocalError: local variable 'setting' referenced before assignment #21

Closed syssi closed 7 years ago

syssi commented 7 years ago
2017-08-02 07:41:17 ERROR (MainThread) [homeassistant.helpers.entity] Update for climate.bathroom fails
Traceback (most recent call last):
  File "/srv/homeassistant/lib/python3.4/site-packages/homeassistant/helpers/entity.py", line 225, in async_update_ha_state
    yield from self.hass.async_add_job(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/lib/python3.4/site-packages/homeassistant/components/climate/tado.py", line 291, in update
    setting = setting is not None
UnboundLocalError: local variable 'setting' referenced before assignment

I'm using HA 0.51.0dev0.

syssi commented 7 years ago

This fix need to be merged into HA: https://github.com/wmalgadey/tado_component/commit/a14a1c6f15d13f178757ea9142f0374622a9d733

syssi commented 7 years ago

Just prepared a PR to fix it asap: https://github.com/home-assistant/home-assistant/pull/8782

syssi commented 7 years ago

Merged.