Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

TypeError: list indices must be integers or slices, not str #1

Closed
mchlrv opened this issue Aug 29, 2024 · 10 comments
Closed

TypeError: list indices must be integers or slices, not str #1

mchlrv opened this issue Aug 29, 2024 · 10 comments
Assignees
Labels
bug Something isn't working

Comments

@mchlrv
Copy link

mchlrv commented Aug 29, 2024

Version: 1.0

After adding the integration and adding my API key I encounter the following error

Traceback (most recent call last):
  File "/usr/src/homeassistant/homeassistant/helpers/update_coordinator.py", line 354, in _async_refresh
    self.data = await self._async_update_data()
                ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
  File "/usr/src/homeassistant/homeassistant/helpers/update_coordinator.py", line 271, in _async_update_data
    return await self.update_method()
           ^^^^^^^^^^^^^^^^^^^^^^^^^^
  File "/config/custom_components/eplucon/__init__.py", line 41, in async_update_data
    realtime_info = await client.get_realtime_info(device_id)
                    ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
  File "/config/custom_components/eplucon/eplucon_api/eplucon_client.py", line 54, in get_realtime_info
    common_info = CommonInfoDTO(**data['data']['common'])
@koenhendriks
Copy link
Owner

At first glance there doesn't seem to be any realtime information for the device you have connected in Eplucon.

Could you tell me what devices you have? I'll try to put some more debugging logs in for version 1.1.0

@mchlrv
Copy link
Author

mchlrv commented Aug 31, 2024

I've got a th-TOUCH connected. Whenever I login to the Eplucon portal I can see the information about this device.

@koenhendriks koenhendriks added the bug Something isn't working label Sep 1, 2024
@koenhendriks
Copy link
Owner

koenhendriks commented Sep 1, 2024

I've released 1.1.0 Beta could you try this and send me the output of the debug?

There should be something along the lines of the following:

[custom_components.eplucon.eplucon_api] Validating API response for {......}

@koenhendriks koenhendriks added the Need more information Need more information from issue creator label Sep 2, 2024
@mchlrv
Copy link
Author

mchlrv commented Sep 3, 2024

Please find the log attached.
home-assistant_eplucon_2024-09-03T06-53-50.650Z.log

@koenhendriks
Copy link
Owner

Alright so from the log it seems that you actually have 2 devices linked in your Eplucon and 1 is working fine (the heat_pump) and another one called zone_controller is not working.

I'm not sure what devices a zone_controller is, but the API does not allow your account to retrieve realtime information from the zone_controller which is why the integration is crashing.

I think I should be able to extend the error handling a bit and remove devices that we get API errors from or maybe just support devices with the type heat_pump for now.

@koenhendriks koenhendriks removed the Need more information Need more information from issue creator label Sep 3, 2024
@koenhendriks koenhendriks self-assigned this Sep 3, 2024
@mchlrv
Copy link
Author

mchlrv commented Sep 4, 2024

The zone_controller is a Touch M-9-R which controls my thermostats. The heat_pump is a rebranded Touch M-9-R (a.k.a. TH-Touch) which only controls my heat pump and not the thermostats.

@koenhendriks
Copy link
Owner

I see. In the current state the integration basically only supports the realtime info API which seems to only work with a heat pump. I will update the code to match this.

I might build support for other types later on but I would first need to setup some mocking tests for the API and need access to a few real API calls where actually data is returned for those devices as the API docs don't go into detail about what they return ( it only states it will return data as an array which ofcourse doesn't help me).

@mchlrv
Copy link
Author

mchlrv commented Sep 4, 2024

I can give you access to my API of that helps.

@koenhendriks
Copy link
Owner

If you could send it to me that would be great!

[email protected]

@koenhendriks
Copy link
Owner

Please update to v1.2.1 this should be fixed now.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug Something isn't working
Projects
None yet
Development

No branches or pull requests

2 participants