mileperhour / localtuya-homeassistant

local handling for Tuya devices
GNU General Public License v3.0
147 stars 667 forks source link

JSONDecodeError on starting up home assistant #10

Open qntris opened 4 years ago

qntris commented 4 years ago

I am getting the following error when home assistant is loading:

2020-04-17 14:53:15 ERROR (MainThread) [homeassistant.components.switch] Error while setting up localtuya platform for switch Traceback (most recent call last): File "/usr/src/homeassistant/homeassistant/helpers/entity_platform.py", line 178, in _async_setup_platform await asyncio.wait_for(asyncio.shield(task), SLOW_SETUP_MAX_WAIT) File "/usr/local/lib/python3.7/asyncio/tasks.py", line 442, in wait_for return fut.result() 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/localtuya/switch.py", line 76, in setup_platform config.get(CONF_VOLTAGE) File "/config/custom_components/localtuya/switch.py", line 148, in __init__ self._status = self._device.status() File "/config/custom_components/localtuya/switch.py", line 129, in status self._cached_status = self.__get_status() File "/config/custom_components/localtuya/switch.py", line 110, in __get_status status = self._device.status() File "/config/custom_components/localtuya/pytuya/__init__.py", line 311, in status result = json.loads(result) 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)