jomwells / ambihue

ON/OFF Abilight+Hue (Switch) component for Philips Ambilight TV's
9 stars 9 forks source link

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

Open igloher opened 4 years ago

igloher commented 4 years ago

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 commented 4 years ago

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 commented 4 years ago

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 commented 4 years ago

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

chillkiller commented 4 years ago

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 ...