oven-lab / tuya_cloud_map_extractor

Tuya cloud vacuum map extractor for Home Assistant
MIT License
22 stars 5 forks source link

[BUG] - list index out of range #36

Open paulka007 opened 3 months ago

paulka007 commented 3 months ago

After completing all the install steps, I try to add the integration but get the error "An unknown error occured. See logs for details." The Tuya & localtuya integration are both installed. I did disable the vac in the localtuya for trobuleshooting. It does appear in the tuya integration as a vacuum and can be triggered from HA. The vacuum is setup in the android Tuya Smart app, with partitions labeled/named, also created overlapping areas. Sweeping Robot Open Service is enabled.

I'm not sure if this is related to #8

To Reproduce Adding the integration with all appropriate IDs.

Version:

Log entry After enabling debug logging in tuya, the two errors are below:

image

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:57
integration: Tuya Cloud Map Extractor (documentation, issues)
First occurred: 11:18:43 AM (3 occurrences)
Last logged: 11:32:55 AM

list index out of range
Traceback (most recent call last):
  File "/config/custom_components/tuya_cloud_map_extractor/config_flow.py", line 57, in async_step_user
    headers, image = await validate(self.hass, user_input)
                     ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
  File "/config/custom_components/tuya_cloud_map_extractor/config_flow.py", line 214, in validate
    return await hass.async_add_executor_job(
           ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
  File "/usr/local/lib/python3.12/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 131, in get_map
    raise e
  File "/config/custom_components/tuya_cloud_map_extractor/tuya_vacuum_map_extractor/main.py", line 127, in get_map
    map_link = link["result"][0]["map_url"]
               ~~~~~~~~~~~~~~^^^
IndexError: list index out of range

image

This error originated from a custom integration.

Logger: custom_components.tuya_cloud_map_extractor.tuya_vacuum_map_extractor.main
Source: custom_components/tuya_cloud_map_extractor/tuya_vacuum_map_extractor/main.py:130
integration: Tuya Cloud Map Extractor (documentation, issues)
First occurred: 11:18:43 AM (4 occurrences)
Last logged: 11:37:10 AM

Encountered an error, please include the following data in your github issue: b'eyJyZXN1bHQiOiBbXSwgInN1Y2Nlc3MiOiB0cnVlLCAidCI6IDE3MTE0NDQ3MjM1NjIsICJ0aWQiOiAiZDc3YzkzYTVlYjUxMTFlZTkxYzAzMjIxZGQ4NDFkOWMifQ=='
Encountered an error, please include the following data in your github issue: b'eyJyZXN1bHQiOiBbXSwgInN1Y2Nlc3MiOiB0cnVlLCAidCI6IDE3MTE0NDU1MjYzODQsICJ0aWQiOiAiYjVmYjhjMmFlYjUzMTFlZTljNjdkMjk2Y2NmNWMwOTEifQ=='
Encountered an error, please include the following data in your github issue: b'eyJyZXN1bHQiOiBbXSwgInN1Y2Nlc3MiOiB0cnVlLCAidCI6IDE3MTE0NDU1NzUxMjcsICJ0aWQiOiAiZDMwZTRjNGNlYjUzMTFlZTkyYWU0NjMwNTdmZTlhMmUifQ=='
Encountered an error, please include the following data in your github issue: b'eyJyZXN1bHQiOiBbXSwgInN1Y2Nlc3MiOiB0cnVlLCAidCI6IDE3MTE0NDU4MzAyMjcsICJ0aWQiOiAiNmIxOTE0MTNlYjU0MTFlZTg0Y2I1MmVkYzJhMWI0YTMifQ=='

Thank you :-)

pacorreia commented 3 months ago

Same here, I use a Neatsvor X600

dan87aut commented 2 months ago

Same here

oven-lab commented 1 month ago

This error results from tuya not offering any map downloads for your vacuum. Nothing can be done until local communitcations are figured out. Will add error handling for this.

ImNoahDev commented 1 month ago

Is there no way to fix this? Im using a Lefant F1