tuya_cloud_map_extractor icon indicating copy to clipboard operation
tuya_cloud_map_extractor copied to clipboard

[BUG] - Unknown Error

Open pscott9598 opened this issue 8 months ago • 20 comments

Describe the bug I have successfully created the tuya integration and I see my vacuum in home assistant and configured the api service mentioned in the your github guide for sweep. When I go to enter the values in the tuya extractor I get an unknown error. I am using the Lidar Rubot brand smart vac and I can see the map with the mobile app and I see on the tuya dev options that it can pull the map somehow but I can't figure it out (I am not that savy and tried to edit your code with chatgpt and I am way over my head)

See error in logs please,

Log details (ERROR) This error originated from a custom integration. Logger: custom_components.tuya_cloud_map_extractor.config_flow Source: custom_components/tuya_cloud_map_extractor/config_flow.py:58 Integration: Tuya Cloud Map Extractor (documentation, issues) First occurred: 9:32:33 PM (4 occurrences) Last logged: 10:44:28 PM

list index out of range Traceback (most recent call last): File "/usr/local/lib/python3.11/site-packages/requests/models.py", line 971, in json return complexjson.loads(self.text, **kwargs) ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ File "/usr/local/lib/python3.11/site-packages/simplejson/init.py", line 514, in loads return _default_decoder.decode(s) ^^^^^^^^^^^^^^^^^^^^^^^^^^ File "/usr/local/lib/python3.11/site-packages/simplejson/decoder.py", line 386, in decode obj, end = self.raw_decode(s) ^^^^^^^^^^^^^^^^^^ File "/usr/local/lib/python3.11/site-packages/simplejson/decoder.py", line 416, in raw_decode return self.scan_once(s, idx=_w(s, idx).end()) ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ simplejson.errors.JSONDecodeError: Expecting value: line 1 column 1 (char 0)

During handling of the above exception, another exception occurred:

Traceback (most recent call last): File "/config/custom_components/tuya_cloud_map_extractor/tuya_vacuum_map_extractor/main.py", line 26, in download_map data = response.json() ^^^^^^^^^^^^^^^ File "/usr/local/lib/python3.11/site-packages/requests/models.py", line 975, in json raise RequestsJSONDecodeError(e.msg, e.doc, e.pos) requests.exceptions.JSONDecodeError: Expecting value: line 1 column 1 (char 0)

During handling of the above exception, another exception occurred:

Traceback (most recent call last): File "/config/custom_components/tuya_cloud_map_extractor/config_flow.py", line 58, in async_step_user info = await validate(self.hass, user_input) ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ File "/config/custom_components/tuya_cloud_map_extractor/config_flow.py", line 95, in validate await hass.async_add_executor_job( File "/usr/local/lib/python3.11/concurrent/futures/thread.py", line 58, in run result = self.fn(*self.args, **self.kwargs) ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ File "/config/custom_components/tuya_cloud_map_extractor/tuya_vacuum_map_extractor/main.py", line 92, in get_map header, map = download_map(map_link) ^^^^^^^^^^^^^^^^^^^^^^ File "/config/custom_components/tuya_cloud_map_extractor/tuya_vacuum_map_extractor/main.py", line 51, in download_map header["roominfo"] = decode_roomArr(mapRoomArr) ^^^^^^^^^^^^^^^^^^^^^^^^^^ File "/config/custom_components/tuya_cloud_map_extractor/tuya_vacuum_map_extractor/v1.py", line 51, in decode_roomArr roomCount = _hexStringToNumber(mapRoomArr.hex()[2:4])[0] ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~^^^ IndexError: list index out of range

Expected behavior When I enter my values it would work.

Thank you for this integration.

pscott9598 avatar Dec 09 '23 04:12 pscott9598