planbnet / livisi_unofficial

Unofficial fork of the home assistant livisi integration without dependencies on the abandoned aiolivisi lib
Apache License 2.0
36 stars 5 forks source link

Error setup SHC Classis #39

Closed bbr111 closed 1 year ago

bbr111 commented 1 year ago

System Health details

Traceback (most recent call last): File "/usr/src/homeassistant/homeassistant/helpers/update_coordinator.py", line 290, in _async_refresh self.data = await self._async_update_data() ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ File "/config/custom_components/livisi/coordinator.py", line 83, in _async_update_data return await self.async_get_devices() ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ File "/config/custom_components/livisi/coordinator.py", line 103, in async_get_devices devices = await self.aiolivisi.async_get_devices() ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ File "/config/custom_components/livisi/livisi_connector.py", line 209, in async_get_devices capability_map[device_id][capability["type"]] = capability["id"]


KeyError: 'type'
2023-10-14 20:20:02.755 ERROR (MainThread) [homeassistant.config_entries] Error setting up entry SHC Classic for livisi
Traceback (most recent call last):
File "/usr/src/homeassistant/homeassistant/config_entries.py", line 399, in async_setup
result = await component.async_setup_entry(hass, self)
^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
File "/config/custom_components/livisi/__init__.py", line 49, in async_setup_entry
await coordinator.async_config_entry_first_refresh()
File "/usr/src/homeassistant/homeassistant/helpers/update_coordinator.py", line 255, in async_config_entry_first_refresh
await self._async_refresh(
File "/usr/src/homeassistant/homeassistant/helpers/update_coordinator.py", line 389, in _async_refresh
self.async_update_listeners()
File "/usr/src/homeassistant/homeassistant/helpers/update_coordinator.py", line 172, in async_update_listeners
update_callback()
File "/config/custom_components/livisi/binary_sensor.py", line 46, in handle_coordinator_update
for device in shc_devices:
TypeError: 'NoneType' object is not iterable

### Checklist

- [X] I have enabled debug logging for my installation.
- [X] I have filled out the issue template to the best of my ability.
- [X] This issue only contains 1 issue (if you have multiple issues, open one issue for each issue).
- [X] This issue is not a duplicate issue of currently [previous issues](https://github.com/ludeeus/integration_blueprint/issues?q=is%3Aissue+label%3A%22Bug%22+)..

### Describe the issue

not setting up

### Reproduction steps

1.
2.
3.
...

### Debug logs

```text
2023-10-14 20:34:32.416 DEBUG (MainThread) [custom_components.livisi] Integrating SHC Classic with serial number: 914100050320
2023-10-14 20:34:37.158 ERROR (MainThread) [custom_components.livisi] Unexpected error fetching Livisi devices data: 'type'
Traceback (most recent call last):
File "/usr/src/homeassistant/homeassistant/helpers/update_coordinator.py", line 290, in _async_refresh
self.data = await self._async_update_data()
^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
File "/config/custom_components/livisi/coordinator.py", line 83, in _async_update_data
return await self.async_get_devices()
^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
File "/config/custom_components/livisi/coordinator.py", line 103, in async_get_devices
devices = await self.aiolivisi.async_get_devices()
^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
File "/config/custom_components/livisi/livisi_connector.py", line 209, in async_get_devices
capability_map[device_id][capability["type"]] = capability["id"]
~~~~~~~~~~^^^^^^^^
KeyError: 'type'
2023-10-14 20:34:37.162 DEBUG (MainThread) [custom_components.livisi] Finished fetching Livisi devices data in 3.594 seconds (success: False)
2023-10-14 20:34:37.163 ERROR (MainThread) [homeassistant.config_entries] Error setting up entry SHC Classic for livisi
Traceback (most recent call last):
File "/usr/src/homeassistant/homeassistant/config_entries.py", line 399, in async_setup
result = await component.async_setup_entry(hass, self)
^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
File "/config/custom_components/livisi/__init__.py", line 49, in async_setup_entry
await coordinator.async_config_entry_first_refresh()
File "/usr/src/homeassistant/homeassistant/helpers/update_coordinator.py", line 255, in async_config_entry_first_refresh
await self._async_refresh(
File "/usr/src/homeassistant/homeassistant/helpers/update_coordinator.py", line 389, in _async_refresh
self.async_update_listeners()
File "/usr/src/homeassistant/homeassistant/helpers/update_coordinator.py", line 172, in async_update_listeners
update_callback()
File "/config/custom_components/livisi/binary_sensor.py", line 46, in handle_coordinator_update
for device in shc_devices:
TypeError: 'NoneType' object is not iterable
```

### Diagnostics dump

_No response_
planbnet commented 1 year ago

Should be fixed in the next update... Though I don't known what device has a capability without a "type"

olli711 commented 11 months ago

i have just the same problem.

Dieser Fehler wurde von einer benutzerdefinierten Integration verursacht

Logger: custom_components.livisi Source: custom_components/livisi/livisi_connector.py:276 Integration: Livisi Unofficial (documentation, issues) First occurred: 08:05:38 (1 occurrences) Last logged: 08:05:38

Error getting device state Traceback (most recent call last): File "/config/custom_components/livisi/livisi_connector.py", line 276, in async_get_device_state response = await self.async_send_authorized_request( ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ File "/config/custom_components/livisi/livisi_connector.py", line 100, in async_send_authorized_request return await self._async_request(method, url, payload, auth_headers) ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ File "/config/custom_components/livisi/livisi_connector.py", line 151, in _async_request if "errorcode" in response: ^^^^^^^^^^^^^^^^^^^^^^^ TypeError: argument of type 'NoneType' is not iterable