CestLaGalere / mobilealerts

Retrieves sensor data for Mobile Alerts sensors for Home Assistant
Apache License 2.0
15 stars 6 forks source link

After restart, mobile_alerts is no longer active #13

Closed ilwalti closed 8 months ago

ilwalti commented 8 months ago

Version 2024.1.2 core / OS 11.3

In system log I've got this error:

Logger: homeassistant.components.sensor Source: helpers/entity_platform.py:360 Integration: Sensor (documentation, issues) First occurred: 23:18:45 (1 occurrences) Last logged: 23:18:45

Error while setting up mobile_alerts platform for sensor Traceback (most recent call last): File "/config/custom_components/mobile_alerts/sensor.py", line 163, in _async_update_data return await self._mobile_alerts_data.fetch_data() ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ File "/config/custom_components/mobile_alerts/sensor.py", line 424, in fetch_data async with session.post(url, data=json_data, headers=headers) as response: File "/usr/local/lib/python3.11/site-packages/aiohttp/client.py", line 1187, in aenter self._resp = await self._coro ^^^^^^^^^^^^^^^^ File "/usr/local/lib/python3.11/site-packages/aiohttp/client.py", line 601, in _request await resp.start(conn) File "/usr/local/lib/python3.11/site-packages/aiohttp/client_reqrep.py", line 965, in start message, payload = await protocol.read() # type: ignore[union-attr] ^^^^^^^^^^^^^^^^^^^^^ File "/usr/local/lib/python3.11/site-packages/aiohttp/streams.py", line 622, in read await self._waiter asyncio.exceptions.CancelledError

During handling of the above exception, another exception occurred:

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/mobile_alerts/sensor.py", line 162, in _async_update_data async with async_timeout.timeout(30): File "/usr/local/lib/python3.11/site-packages/async_timeout/init.py", line 141, in aexit self._do_exit(exc_type) File "/usr/local/lib/python3.11/site-packages/async_timeout/init.py", line 228, in _do_exit raise asyncio.TimeoutError TimeoutError

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

Traceback (most recent call last): File "/usr/src/homeassistant/homeassistant/helpers/entity_platform.py", line 360, in _async_setup_platform await asyncio.shield(task) File "/config/custom_components/mobile_alerts/sensor.py", line 121, in async_setup_platform await coordinator.async_config_entry_first_refresh() File "/usr/src/homeassistant/homeassistant/helpers/update_coordinator.py", line 272, in async_config_entry_first_refresh raise ex homeassistant.exceptions.ConfigEntryNotReady

After this, no sensor data are received - all sensor are marked as: "This entity is no longer being provided by the mobile_alerts integration. If the entity is no longer in use, delete it in settings."

ilwalti commented 8 months ago

Resolved with a version rollback.