Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Hue dependency buggy #7749

Closed
costastf opened this issue May 24, 2017 · 1 comment · Fixed by #8444
Closed

Hue dependency buggy #7749

costastf opened this issue May 24, 2017 · 1 comment · Fixed by #8444

Comments

@costastf
Copy link
Contributor

Make sure you are running the latest version of Home Assistant before reporting an issue.

You should only file an issue if you found a bug. Feature and enhancement requests should go in the Feature Requests section of our community forum:

Home Assistant release (hass --version):
Running home assistant through docker. This issue appears at least in versions 0.32, 0.39, 0.45 so I would guess that it appears in all in between versions.

Python release (python3 --version):

Component/platform:
Philips hue dependency phue.py

Description of problem:
On version 0.9 of phue there is a bug with a connection being closed before the response is managed which leads to it returning None when it should return values. This leads to a crash on the Home Assistant component that manages the lights since it is expecting json and getting None instead.

Expected:
Lights being detected and working properly.

Problem-relevant configuration.yaml entries and steps to reproduce:
The standard configuration is enough for the malfunction.

Traceback (if applicable):

home-assistant    | XX-XX-XX XX:XX:XX ERROR (MainThread) [homeassistant.components.light] Error while setting up platform hue
home-assistant    | Traceback (most recent call last):
home-assistant    |   File "/usr/src/app/homeassistant/helpers/entity_component.py", line 151, in _async_setup_platform
home-assistant    |     entity_platform.add_entities, discovery_info
home-assistant    |   File "uvloop/future.pyx", line 230, in __iter__ (uvloop/loop.c:110600)
home-assistant    |   File "uvloop/future.pyx", line 432, in uvloop.loop.BaseTask._fast_wakeup (uvloop/loop.c:113980)
home-assistant    |   File "uvloop/future.pyx", line 101, in uvloop.loop.BaseFuture._result_impl (uvloop/loop.c:108900)
home-assistant    |   File "/usr/local/lib/python3.5/concurrent/futures/thread.py", line 55, in run
home-assistant    |     result = self.fn(*self.args, **self.kwargs)
home-assistant    |   File "/usr/src/app/homeassistant/components/light/hue.py", line 128, in setup_platform
home-assistant    |     allow_in_emulated_hue, allow_hue_groups)
home-assistant    |   File "/usr/src/app/homeassistant/components/light/hue.py", line 248, in setup_bridge
home-assistant    |     update_lights()
home-assistant    |   File "/usr/src/app/homeassistant/util/__init__.py", line 296, in wrapper
home-assistant    |     result = method(*args, **kwargs)
home-assistant    |   File "/usr/src/app/homeassistant/util/__init__.py", line 296, in wrapper
home-assistant    |     result = method(*args, **kwargs)
home-assistant    |   File "/usr/src/app/homeassistant/components/light/hue.py", line 172, in update_lights
home-assistant    |     api = bridge.get_api()
home-assistant    |   File "/usr/local/lib/python3.5/site-packages/phue.py", line 838, in get_api
home-assistant    |     return self.request('GET', '/api/' + self.username)
home-assistant    |   File "/usr/local/lib/python3.5/site-packages/phue.py", line 666, in request
home-assistant    |     return json.loads(str(result.read(), encoding='utf-8'))
home-assistant    |   File "/usr/local/lib/python3.5/json/__init__.py", line 319, in loads
home-assistant    |     return _default_decoder.decode(s)
home-assistant    |   File "/usr/local/lib/python3.5/json/decoder.py", line 339, in decode
home-assistant    |     obj, end = self.raw_decode(s, idx=_w(s, 0).end())
home-assistant    |   File "/usr/local/lib/python3.5/json/decoder.py", line 357, in raw_decode
home-assistant    |     raise JSONDecodeError("Expecting value", s, err.value) from None
home-assistant    | json.decoder.JSONDecodeError: Expecting value: line 1 column 1 (char 0)

Additional info:
This issue is fixed in the phue library with PR #109 studioimaginaire/phue#106 .
It is fixed in current master and I have requested a tag of 0.9.1 so it can be updated on Home Assistant. This needs some monitoring on Home Assistant part so it updates when the dependency bumps its version.

@costastf
Copy link
Contributor Author

costastf commented Jul 2, 2017

Phue just released version 1.0 that carries this fix. Dependency should be updated to that version.

Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
None yet
Projects
None yet
1 participant