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

Expecting value: line 1 column 1 (char 0) #4

Open
igloher opened this issue May 29, 2020 · 4 comments
Open

Expecting value: line 1 column 1 (char 0) #4

igloher opened this issue May 29, 2020 · 4 comments

Comments

@igloher
Copy link

igloher commented May 29, 2020

Logger: homeassistant.components.websocket_api.http.connection.2984866936
Source: custom_components/philips_ambilight+hue/switch.py:113
Integration: Home Assistant WebSocket API (documentation, issues)
First occurred: 20:46:56 (2 occurrences)
Last logged: 20:47:08

Expecting value: line 1 column 1 (char 0)
Traceback (most recent call last):
File "/data/data/com.termux/files/home/homeassistant/lib/python3.8/site-packages/homeassistant/components/websocket_api/commands.py", line 125, in handle_call_service
await hass.services.async_call(
File "/data/data/com.termux/files/home/homeassistant/lib/python3.8/site-packages/homeassistant/core.py", line 1253, in async_call
task.result()
File "/data/data/com.termux/files/home/homeassistant/lib/python3.8/site-packages/homeassistant/core.py", line 1288, in _execute_service
await handler.func(service_call)
File "/data/data/com.termux/files/home/homeassistant/lib/python3.8/site-packages/homeassistant/helpers/entity_component.py", line 212, in handle_service
await self.hass.helpers.service.entity_service_call(
File "/data/data/com.termux/files/home/homeassistant/lib/python3.8/site-packages/homeassistant/helpers/service.py", line 454, in entity_service_call
future.result() # pop exception if have
File "/data/data/com.termux/files/home/homeassistant/lib/python3.8/site-packages/homeassistant/helpers/entity.py", line 597, in async_request_call
await coro
File "/data/data/com.termux/files/home/homeassistant/lib/python3.8/site-packages/homeassistant/helpers/service.py", line 485, in _handle_entity_call
await result
File "/data/data/com.termux/files/home/homeassistant/lib/python3.8/site-packages/homeassistant/helpers/entity.py", line 630, in async_turn_off
await self.hass.async_add_executor_job(ft.partial(self.turn_off, **kwargs))
File "/data/data/com.termux/files/usr/lib/python3.8/concurrent/futures/thread.py", line 57, in run
result = self.fn(*self.args, **self.kwargs)
File "/data/data/com.termux/files/home/.homeassistant/custom_components/philips_ambilight+hue/switch.py", line 74, in turn_off
self._postReq('menuitems/settings/update', {"values":[{"value":{"Nodeid":self._nodeId,"Controllable":"true","Available":"true","data":{"value":"false"}}}]} )
File "/data/data/com.termux/files/home/.homeassistant/custom_components/philips_ambilight+hue/switch.py", line 113, in _postReq
return json.loads(resp.text)
File "/data/data/com.termux/files/usr/lib/python3.8/json/init.py", line 357, in loads
return _default_decoder.decode(s)
File "/data/data/com.termux/files/usr/lib/python3.8/json/decoder.py", line 337, in decode
obj, end = self.raw_decode(s, idx=_w(s, 0).end())
File "/data/data/com.termux/files/usr/lib/python3.8/json/decoder.py", line 355, in raw_decode
raise JSONDecodeError("Expecting value", s, err.value) from None
json.decoder.JSONDecodeError: Expecting value: line 1 column 1 (char 0)
Error al llamar al servicio switch/turn_on. Expecting value: line 1 column 1 (char 0)

@Ruaktom
Copy link

Ruaktom commented Jul 24, 2020

Hi, having the same issue here:

Logger: homeassistant.components.websocket_api.http.connection.2934769904
Source: custom_components/philips_ambilight+hue/switch.py:113
Integration: Home Assistant WebSocket API (documentation, issues)
First occurred: 12:24:32 PM (1 occurrences)
Last logged: 12:24:32 PM

Expecting value: line 1 column 1 (char 0)
Traceback (most recent call last):
File "/usr/src/homeassistant/homeassistant/components/websocket_api/commands.py", line 130, in handle_call_service
connection.context(msg),
File "/usr/src/homeassistant/homeassistant/core.py", line 1260, in async_call
task.result()
File "/usr/src/homeassistant/homeassistant/core.py", line 1295, in _execute_service
await handler.func(service_call)
File "/usr/src/homeassistant/homeassistant/helpers/entity_component.py", line 209, in handle_service
self._platforms.values(), func, call, required_features
File "/usr/src/homeassistant/homeassistant/helpers/service.py", line 454, in entity_service_call
future.result() # pop exception if have
File "/usr/src/homeassistant/homeassistant/helpers/entity.py", line 595, in async_request_call
await coro
File "/usr/src/homeassistant/homeassistant/helpers/service.py", line 485, in _handle_entity_call
await result
File "/usr/src/homeassistant/homeassistant/helpers/entity.py", line 621, in async_turn_on
await self.hass.async_add_executor_job(ft.partial(self.turn_on, **kwargs))
File "/usr/local/lib/python3.7/concurrent/futures/thread.py", line 57, in run
result = self.fn(*self.args, **self.kwargs)
File "/config/custom_components/philips_ambilight+hue/switch.py", line 70, in turn_on
self._postReq('menuitems/settings/update', {"values":[{"value":{"Nodeid":self._nodeId,"Controllable":"true","Available":"true","data":{"value":"true"}}}]} )
File "/config/custom_components/philips_ambilight+hue/switch.py", line 113, in _postReq
return json.loads(resp.text)
File "/usr/local/lib/python3.7/json/init.py", line 348, in loads
return _default_decoder.decode(s)
File "/usr/local/lib/python3.7/json/decoder.py", line 337, in decode
obj, end = self.raw_decode(s, idx=_w(s, 0).end())
File "/usr/local/lib/python3.7/json/decoder.py", line 355, in raw_decode
raise JSONDecodeError("Expecting value", s, err.value) from None
json.decoder.JSONDecodeError: Expecting value: line 1 column 1 (char 0)

@marcokitzmann
Copy link

Same (or similar) here:

Logger: homeassistant.components.websocket_api.http.connection.2884921808
Source: custom_components/philips_ambilight+hue/switch.py:113
Integration: Home Assistant WebSocket API (documentation, issues)
First occurred: 23:02:55 (4 occurrences)
Last logged: 23:03:10

Expecting value: line 1 column 1 (char 0)
Traceback (most recent call last):
File "/usr/src/homeassistant/homeassistant/components/websocket_api/commands.py", line 125, in handle_call_service
await hass.services.async_call(
File "/usr/src/homeassistant/homeassistant/core.py", line 1250, in async_call
task.result()
File "/usr/src/homeassistant/homeassistant/core.py", line 1285, in _execute_service
await handler.func(service_call)
File "/usr/src/homeassistant/homeassistant/helpers/entity_component.py", line 208, in handle_service
await self.hass.helpers.service.entity_service_call(
File "/usr/src/homeassistant/homeassistant/helpers/service.py", line 454, in entity_service_call
future.result() # pop exception if have
File "/usr/src/homeassistant/homeassistant/helpers/entity.py", line 595, in async_request_call
await coro
File "/usr/src/homeassistant/homeassistant/helpers/service.py", line 485, in _handle_entity_call
await result
File "/usr/src/homeassistant/homeassistant/helpers/entity.py", line 630, in async_turn_off
await self.hass.async_add_executor_job(ft.partial(self.turn_off, **kwargs))
File "/usr/local/lib/python3.8/concurrent/futures/thread.py", line 57, in run
result = self.fn(*self.args, **self.kwargs)
File "/config/custom_components/philips_ambilight+hue/switch.py", line 74, in turn_off
self._postReq('menuitems/settings/update', {"values":[{"value":{"Nodeid":self._nodeId,"Controllable":"true","Available":"true","data":{"value":"false"}}}]} )
File "/config/custom_components/philips_ambilight+hue/switch.py", line 113, in _postReq
return json.loads(resp.text)
File "/usr/local/lib/python3.8/json/init.py", line 357, in loads
return _default_decoder.decode(s)
File "/usr/local/lib/python3.8/json/decoder.py", line 337, in decode
obj, end = self.raw_decode(s, idx=_w(s, 0).end())
File "/usr/local/lib/python3.8/json/decoder.py", line 355, in raw_decode
raise JSONDecodeError("Expecting value", s, err.value) from None
json.decoder.JSONDecodeError: Expecting value: line 1 column 1 (char 0)

@halfofabanana
Copy link

See my fork for a solution. I'll try and get a pull request up in the next week or so.

@chillkiller
Copy link

chillkiller commented Aug 1, 2020

See my fork for a solution. I'll try and get a pull request up in the next week or so.

You inserted 6 new lines 113-119...
That code fix it ??

Yeaeh... awesome... the log entry is gone ...

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

5 participants