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

Fix import error #30

Closed Ernst79 closed 4 months ago

Ernst79 commented 5 months ago

Fix import error #29

brandhout commented 4 months ago

Hi Ernst, is there a specific version of home assistant or python needed? After applying this commit I'm running into the next error

` Traceback (most recent call last): File "/usr/src/homeassistant/homeassistant/helpers/update_coordinator.py", line 313, in _async_refresh self.data = await self._async_update_data() ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ File "/config/custom_components/degree_days/init.py", line 128, in _async_update_data data = await self.hass.async_add_executor_job( ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ File "/usr/local/lib/python3.12/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 35, in init self.gas_per_weighted_degree_day = data["consumption_per_weighted_degree_day"]


KeyError: 'consumption_per_weighted_degree_day'
` 
Ernst79 commented 4 months ago

Can you try it with the change in commit 93e843d?

brandhout commented 4 months ago

Can you try it with the change in commit 93e843d?

The integration does start without errors now so it seems fixed. Awesome, thanks!