jaroschek / home-assistant-myuplink

Custom Home Assistant integration for devices and sensors in myUplink account.
39 stars 8 forks source link

Integration stop working #84

Closed simonepittis closed 4 months ago

simonepittis commented 4 months ago

Version 1.2.0

Logger: homeassistant.config_entries Source: config_entries.py:406 First occurred: 14:55:44 (1 occurrences) Last logged: 14:55:44

Error setting up entry Boiler for myuplink Traceback (most recent call last): File "/usr/src/homeassistant/homeassistant/config_entries.py", line 406, in async_setup result = await component.async_setup_entry(hass, self) ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ File "/config/custom_components/myuplink/init.py", line 73, in async_setup_entry await coordinator.async_config_entry_first_refresh() File "/usr/src/homeassistant/homeassistant/helpers/update_coordinator.py", line 265, in async_config_entry_first_refresh await self._async_refresh( File "/usr/src/homeassistant/homeassistant/helpers/update_coordinator.py", line 300, in _async_refresh self.data = await self._async_update_data() ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ File "/usr/src/homeassistant/homeassistant/helpers/update_coordinator.py", line 256, in _async_update_data return await self.update_method() ^^^^^^^^^^^^^^^^^^^^^^^^^^ File "/config/custom_components/myuplink/init.py", line 55, in async_update_data return await api.get_systems() ^^^^^^^^^^^^^^^^^^^^^^^ File "/config/custom_components/myuplink/api.py", line 508, in get_systems await system.async_fetch_data() File "/config/custom_components/myuplink/api.py", line 459, in async_fetch_data await device.async_fetch_data() File "/config/custom_components/myuplink/api.py", line 408, in async_fetch_data self.parameters = await self.system.api.get_parameters(self) ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ File "/config/custom_components/myuplink/api.py", line 544, in get_parameters async with self.lock, self.throttle: File "/config/custom_components/myuplink/api.py", line 476, in aenter await asyncio.sleep(delay) File "/usr/local/lib/python3.11/asyncio/tasks.py", line 649, in sleep return await future ^^^^^^^^^^^^ asyncio.exceptions.CancelledError

simonepittis commented 4 months ago

rollback to version 1.1.6 and works... but good work :-)

jaroschek commented 4 months ago

Thanks! I made some research regarding this error. And it seems to be caused by some other process cancelling the sleep task that is used to throttle the api calls.

It's strange that it only occurs in version 1.2.0 and not in the other previous versions. However, it could be related to the three additional API calls required by the new sensors for connectivity, firmware information and notifications. This makes greater use of throttling (sleep tasks), which would lead to a higher probability of disruptive processes.

The usual solution seems to be to simply suppress this error. I have prepared a pre-release version that you can test: https://github.com/jaroschek/home-assistant-myuplink/releases/tag/1.2.1-rc1

simonepittis commented 4 months ago

the change works. no errors and the device loads without problems. Thanks