Ernst79 / degree-days

Integration that determines (weighted) degree days, gas consumption per degree day and a gas prognose for the current year based on weather info from the KNMI and your gas consumption.
MIT License
7 stars 3 forks source link

failed to calculate float divide by zero #20

Closed jordy101091 closed 6 months ago

jordy101091 commented 6 months ago

This is the exception from the Hassio Logs

`Deze fout is ontstaan door een aangepaste integratie.

Logger: custom_components.degree_days Source: helpers/update_coordinator.py:300 Integration: Degree-Days First occurred: 23:52:12 (15 occurrences) Last logged: 23:59:07

Unexpected error fetching Degree Days data: float division by zero Traceback (most recent call last): File "/usr/src/homeassistant/homeassistant/helpers/update_coordinator.py", line 300, in _async_refresh self.data = await self._async_update_data() ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ File "/config/custom_components/degree_days/init.py", line 117, in _async_update_data data = await self.hass.async_add_executor_job( ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ File "/usr/local/lib/python3.11/concurrent/futures/thread.py", line 58, in run result = self.fn(*self.args, *self.kwargs) ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ File "/config/custom_components/degree_days/knmi/init.py", line 19, in init data = self.get_degree_days() ^^^^^^^^^^^^^^^^^^^^^^ File "/config/custom_components/degree_days/knmi/init.py", line 90, in get_degree_days gas_consumption_total = self.gas_usage number_of_days_knmi / number_of_days_gas


ZeroDivisionError: float division by zero
`
nelbs commented 6 months ago

There seems to be a problem with the knmi api. The data from this year is not yet available. When it becomes available everything should work again.

Ernst79 commented 6 months ago

Fixed in 0.9.3