epoplavskis / homeassistant_salus

Home Assistant integration with Salus devices
MIT License
48 stars 17 forks source link

AttributeError: 'NoneType' object has no attribute 'available' #62

Open peter4200 opened 2 months ago

peter4200 commented 2 months ago

My home-assistant.log are filled with the error below and then, after some time, my HA stops working. I don't if the Salus integration is the problem, bur I'm trying to find the root cause to why my HA is stopping. I'm on the latest version of everything :-)

2024-08-28 13:40:23.107 ERROR (MainThread) [homeassistant] Error doing job: Task exception was never retrieved (None)
Traceback (most recent call last):
  File "/usr/src/homeassistant/homeassistant/helpers/update_coordinator.py", line 258, in _handle_refresh_interval
    await self._async_refresh(log_failures=True, scheduled=True)
  File "/usr/src/homeassistant/homeassistant/helpers/update_coordinator.py", line 453, in _async_refresh
    self.async_update_listeners()
  File "/usr/src/homeassistant/homeassistant/helpers/update_coordinator.py", line 168, in async_update_listeners
    update_callback()
  File "/usr/src/homeassistant/homeassistant/helpers/entity.py", line 1005, in async_write_ha_state
    self._async_write_ha_state()
  File "/usr/src/homeassistant/homeassistant/helpers/entity.py", line 1130, in _async_write_ha_state
    self.__async_calculate_state()
  File "/usr/src/homeassistant/homeassistant/helpers/entity.py", line 1066, in __async_calculate_state
    available = self.available  # only call self.available once per update cycle
                ^^^^^^^^^^^^^^
  File "/config/custom_components/salus/binary_sensor.py", line 90, in available
    return self._coordinator.data.get(self._idx).available
           ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
AttributeError: 'NoneType' object has no attribute 'available'