github jmcollin78/solar_optimizer 1.2.2
FIX NPE in sensor

latest releases: 1.7.1, 1.7.0, 1.7.0.beta1...
13 months ago

If no calculation is done (production is not available for example), a NullPointerException occurs in sensor.py:

2023-08-04 21:23:28.414 ERROR (MainThread) [homeassistant] Error doing job: Task exception was never retrieved
Traceback (most recent call last):
  File "/usr/src/homeassistant/homeassistant/helpers/update_coordinator.py", line 229, in _handle_refresh_interval
    await self._async_refresh(log_failures=True, scheduled=True)
  File "/usr/src/homeassistant/homeassistant/helpers/update_coordinator.py", line 374, in _async_refresh
    self.async_update_listeners()
  File "/usr/src/homeassistant/homeassistant/helpers/update_coordinator.py", line 164, in async_update_listeners
    update_callback()
  File "/config/custom_components/solar_optimizer/sensor.py", line 57, in _handle_coordinator_update
    value = self.coordinator.data.get(self.idx)
            ^^^^^^^^^^^^^^^^^^^^^^^^^
AttributeError: 'NoneType' object has no attribute 'get'

Don't miss a new solar_optimizer release

NewReleases is sending notifications on new releases.