Tado integration - Add Support for tado X devices

Hi @dmho and @mluecke ,

I think I could fix my problem with the error: IndexError: list index out of range

  1. I downloaded and made the modifications from Karls post 225.
  2. In manifest.json I changed requirements to "requirements": ["python-tado==0.18.15"] and rebooted.
  3. Logged in with my account and got the out of range error.
  4. I modified/replaced the lines 96 - 99 in coordinator.py with:
     self.devices = [
         device if isinstance(device, dict)
         else device[0]
         for device in self.devices
         if (isinstance(device, dict) or (isinstance(device, list) and len(device) > 0))
     ]
  1. Again in coordinator.py the lines 161 - 170 are replaced with:
     for device in devices:
        if self.is_x:
            if isinstance(device, dict):
                device_short_serial_no = device.get("serialNumber")
            elif isinstance(device, list) and len(device) > 0 and isinstance(device[0], dict):
                device_short_serial_no = device[0].get("serialNumber")
                device = device[0]
            else:
                _LOGGER.warning("Skipping invalid device format: %s", device)
                continue
        else:
            device_short_serial_no = device.get("shortSerialNo")

        _LOGGER.debug("Updating device %s", device_short_serial_no)
  1. After that I rebooted and renewed the authorization again.

I will see, if the authorization will survive 24 hours.

What I found out with a little debugging, the out of range errors is, that the last device in that list is empty:

2025-10-06 08:47:22.956 ERROR (MainThread) [custom_components.tado.coordinator] Device 10: type=<class 'list'>, value=[]
2025-10-06 08:47:22.956 ERROR (MainThread) [custom_components.tado.coordinator] Problematic device at index 10: value=[]

I have 10 Tado X devices, but the list starts with the index 0, so the correct range would be 0 - 9.