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

list_actions() throws a JSONDecodeError #5

Closed
pbackx opened this issue Dec 30, 2018 · 2 comments
Closed

list_actions() throws a JSONDecodeError #5

pbackx opened this issue Dec 30, 2018 · 2 comments

Comments

@pbackx
Copy link
Contributor

pbackx commented Dec 30, 2018

When enabling the Niko home control integration in Home Assistant, the following error appears in the logs:

2018-12-30 10:27:10 ERROR (MainThread) [homeassistant.components.light] Error while setting up platform niko_home_control Traceback (most recent call last): File "/srv/homeassistant/lib/python3.5/site-packages/homeassistant/helpers/entity_platform.py", line 128, in _async_setup_platform SLOW_SETUP_MAX_WAIT, loop=hass.loop) File "/usr/lib/python3.5/asyncio/tasks.py", line 400, in wait_for return fut.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 "/srv/homeassistant/lib/python3.5/site-packages/homeassistant/components/light/niko_home_control.py", line 44, in setup_platform [NikoHomeControlLight(light, hub) for light in hub.list_actions()], File "/srv/homeassistant/lib/python3.5/site-packages/nikohomecontrol/__init__.py", line 35, in list_actions return [Action(action, self) for action in self.list_actions_raw()] File "/srv/homeassistant/lib/python3.5/site-packages/nikohomecontrol/__init__.py", line 32, in list_actions_raw return self._command('{"cmd":"listactions"}') File "/srv/homeassistant/lib/python3.5/site-packages/nikohomecontrol/__init__.py", line 52, in _command data = json.load(StringIO(self._socket.recv(8192).decode())) File "/usr/lib/python3.5/json/__init__.py", line 268, in load parse_constant=parse_constant, object_pairs_hook=object_pairs_hook, **kw) File "/usr/lib/python3.5/json/__init__.py", line 319, in loads return _default_decoder.decode(s) File "/usr/lib/python3.5/json/decoder.py", line 339, in decode obj, end = self.raw_decode(s, idx=_w(s, 0).end()) File "/usr/lib/python3.5/json/decoder.py", line 355, in raw_decode obj, end = self.scan_once(s, idx) json.decoder.JSONDecodeError: Expecting ',' delimiter: line 1 column 1357 (char 1356)

Tracing this back, I see Home Assistant depends on version 0.1.8 of this niko-home-control component. I'm a bit new to the Python ecosystem, so I'm not sure which commit that version relates to. Maybe there is a newer version without the issue.

If this is not a known issue, I will set up a local copy of this project to figure out what's going on, but I first wanted to check whether or not this was already investigated.

BTW: I'm not sure if it matters, but I have Niko Home Control I. There's now also a Niko Home Control II, but I think this is only available in Belgium right now (I could only find this page in Dutch: https://www.niko.eu/nlbe/software )

BTW2: Thanks for the project!

@pbackx
Copy link
Contributor Author

pbackx commented Dec 30, 2018

It looks like the code for the 0.1.8 release is not in this repository. The 0.1.8 code uses a Hub object which does not exist in the code (I checked the available commits and could not find it)

@NoUseFreak
Copy link
Owner

@pbackx I have a new PR out for HA that will use v0.2.0 that should fix these issues.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants