Andre0512 / hon

Home Assistant integration for Haier hOn: support for Haier/Candy/Hoover home appliances like washing machines and air conditioners in 28 languages.
MIT License
1.24k stars 2.49k forks source link

Unexpected error fetching a8-48-fa-18-ef-e4 data: 'NoneType' object is not subscriptable #80

Closed tempus2016 closed 11 months ago

tempus2016 commented 11 months ago

Another error popped up.

This error originated from a custom integration.

Logger: custom_components.hon.hon
Source: custom_components/hon/hon.py:64
Integration: Haier hOn (documentation, issues)
First occurred: 13:22:36 (2 occurrences)
Last logged: 15:57:19

Unexpected error fetching a8-48-fa-18-ef-e4 data: 'NoneType' object is not subscriptable
Traceback (most recent call last):
  File "/usr/src/homeassistant/homeassistant/helpers/update_coordinator.py", line 283, in _async_refresh
    self.data = await self._async_update_data()
                ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
  File "/config/custom_components/hon/hon.py", line 64, in _async_update_data
    await self._device.update()
  File "/usr/local/lib/python3.11/site-packages/pyhon/appliance.py", line 261, in update
    await self.load_attributes()
  File "/usr/local/lib/python3.11/site-packages/pyhon/appliance.py", line 246, in load_attributes
    self._attributes = self._extra.attributes(self._attributes)
                       ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
  File "/usr/local/lib/python3.11/site-packages/pyhon/appliances/td.py", line 8, in attributes
    if data["lastConnEvent"]["category"] == "DISCONNECTED":
       ~~~~~~~~~~~~~~~~~~~~~^^^^^^^^^^^^
TypeError: 'NoneType' object is not subscriptable
Andre0512 commented 11 months ago

Duplicate of #77