GuyKh / iec-custom-component

HomeAssistant Custom Component for IEC
MIT License
131 stars 5 forks source link

chore: bump iec-api to 0.4.7 #213

Closed GuyKh closed 1 week ago

doron1 commented 1 week ago

Following this update, all attempts to add an entry fail on timeout ("unknown error occured" on UI)

`Log details (ERROR) This error originated from a custom integration. Logger: custom_components.iec.coordinator Source: helpers/update_coordinator.py:354 integration: Israel Electric Corporation (IEC) (documentation, issues) First occurred: 15:14:04 (3 occurrences) Last logged: 15:29:35

Unexpected error fetching Iec data Traceback (most recent call last): File "/usr/local/lib/python3.12/site-packages/aiohttp/client_reqrep.py", line 1022, in start message, payload = await protocol.read() # type: ignore[union-attr] ^^^^^^^^^^^^^^^^^^^^^ File "/usr/local/lib/python3.12/site-packages/aiohttp/streams.py", line 643, in read await self._waiter asyncio.exceptions.CancelledError

The above exception was the direct cause of the following exception:

Traceback (most recent call last): File "/usr/local/lib/python3.12/site-packages/iec_api/commons.py", line 116, in send_get_request resp = await session.get(url=url, headers=headers, timeout=timeout) ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ File "/usr/local/lib/python3.12/site-packages/aiohttp/client.py", line 686, in _request await resp.start(conn) File "/usr/local/lib/python3.12/site-packages/aiohttp/client_reqrep.py", line 1017, in start with self._timer: File "/usr/local/lib/python3.12/site-packages/aiohttp/helpers.py", line 736, in exit raise asyncio.TimeoutError from exc_val TimeoutError

During handling of the above exception, another exception occurred:

Traceback (most recent call last): File "/usr/src/homeassistant/homeassistant/helpers/update_coordinator.py", line 354, in _async_refresh self.data = await self._async_update_data() ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ File "/config/custom_components/iec/coordinator.py", line 374, in _async_update_data all_contracts: list[Contract] = await self.api.get_contracts(self._bp_number) ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ File "/usr/local/lib/python3.12/site-packages/iec_api/iec_client.py", line 164, in get_contracts get_contract_response = await data.get_contracts(self._session, self._token, bp_number) ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ File "/usr/local/lib/python3.12/site-packages/iec_api/data.py", line 195, in get_contracts return await _get_response_with_descriptor( ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ File "/usr/local/lib/python3.12/site-packages/iec_api/data.py", line 77, in _get_response_with_descriptor response = await commons.send_get_request(session=session, url=request_url, headers=headers) ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ File "/usr/local/lib/python3.12/site-packages/iec_api/commons.py", line 119, in send_get_request raise IECError(-1, f"Failed to communicate with IEC API due to time out: ({str(ex)})") iec_api.models.exceptions.IECError: (Code -1): Failed to communicate with IEC API due to time out: ()`

GuyKh commented 1 week ago

This is timeout in calling the API. please retry later