skodaconnect / homeassistant-myskoda

Homeassistant integration for MySkoda.
7 stars 3 forks source link

'Error on device update' when position not shared #24

Open dvx76 opened 6 days ago

dvx76 commented 6 days ago

Haven't looked at this yet. Just so I don't forget. My position is currently not shared and I get this:

2024-09-22 11:30:14.346 ERROR (MainThread) [homeassistant.components.sensor] myskoda: Error on device update!
Traceback (most recent call last):
  File "/home/fdevaux/dev/github/homeassistant-core/homeassistant/helpers/update_coordinator.py", line 453, in _async_refresh
    self.async_update_listeners()
  File "/home/fdevaux/dev/github/homeassistant-core/homeassistant/helpers/update_coordinator.py", line 168, in async_update_listeners
    update_callback()
  File "/home/fdevaux/dev/github/homeassistant-core/homeassistant/helpers/update_coordinator.py", line 533, in _handle_coordinator_update
    self.async_write_ha_state()
  File "/home/fdevaux/dev/github/homeassistant-core/homeassistant/helpers/entity.py", line 1005, in async_write_ha_state
    self._async_write_ha_state()
  File "/home/fdevaux/dev/github/homeassistant-core/homeassistant/helpers/entity.py", line 1130, in _async_write_ha_state
    self.__async_calculate_state()
  File "/home/fdevaux/dev/github/homeassistant-core/homeassistant/helpers/entity.py", line 1067, in __async_calculate_state
    state = self._stringify_state(available)
            ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
  File "/home/fdevaux/dev/github/homeassistant-core/homeassistant/helpers/entity.py", line 1011, in _stringify_state
    if (state := self.state) is None:
                 ^^^^^^^^^^
  File "/home/fdevaux/dev/github/homeassistant-core/homeassistant/components/device_tracker/config_entry.py", line 238, in state
    if self.latitude is not None and self.longitude is not None:
       ^^^^^^^^^^^^^
  File "/home/fdevaux/dev/github/homeassistant-core/config/custom_components/myskoda/device_tracker.py", line 66, in latitude
    position = self._vehicle_position()
               ^^^^^^^^^^^^^^^^^^^^^^^^
  File "/home/fdevaux/dev/github/homeassistant-core/config/custom_components/myskoda/device_tracker.py", line 54, in _vehicle_position
    return next(
           ^^^^^
StopIteration

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

Traceback (most recent call last):
  File "/home/fdevaux/dev/github/homeassistant-core/homeassistant/helpers/entity_platform.py", line 724, in _async_add_entity
    await entity.async_device_update(warning=False)
  File "/home/fdevaux/dev/github/homeassistant-core/homeassistant/helpers/entity.py", line 1300, in async_device_update
    await self.async_update()
  File "/home/fdevaux/dev/github/homeassistant-core/homeassistant/helpers/update_coordinator.py", line 571, in async_update
    await self.coordinator.async_request_refresh()
  File "/home/fdevaux/dev/github/homeassistant-core/homeassistant/helpers/update_coordinator.py", line 265, in async_request_refresh
    await self._debounced_refresh.async_call()
  File "/home/fdevaux/dev/github/homeassistant-core/homeassistant/helpers/debounce.py", line 114, in async_call
    await task
  File "/home/fdevaux/dev/github/homeassistant-core/homeassistant/helpers/update_coordinator.py", line 330, in async_refresh
    await self._async_refresh(log_failures=True)
RuntimeError: coroutine raised StopIteration
Prior99 commented 6 days ago

I can confirm

2024-09-22 13:57:59.251 ERROR (MainThread) [custom_components.myskoda.coordinator] Unexpected exception from <bound method MySkodaDataUpdateCoordinator._update_air_conditioning of <custom_components.myskoda.coordinator.MySkodaDataUpdateCoordinator object at 0x74697290a8a0>>
Traceback (most recent call last):
  File "/home/prior/repositories/homeassistant-core/config/custom_components/myskoda/coordinator.py", line 180, in _update_air_conditioning
    self.set_updated_vehicle(vehicle)
  File "/home/prior/repositories/homeassistant-core/config/custom_components/myskoda/coordinator.py", line 159, in set_updated_vehicle
    self.async_set_updated_data(self.data)
  File "/home/prior/repositories/homeassistant-core/homeassistant/helpers/update_coordinator.py", line 489, in async_set_updated_data
    self.async_update_listeners()
  File "/home/prior/repositories/homeassistant-core/homeassistant/helpers/update_coordinator.py", line 168, in async_update_listeners
    update_callback()
  File "/home/prior/repositories/homeassistant-core/homeassistant/helpers/update_coordinator.py", line 533, in _handle_coordinator_update
    self.async_write_ha_state()
  File "/home/prior/repositories/homeassistant-core/homeassistant/helpers/entity.py", line 1005, in async_write_ha_state
    self._async_write_ha_state()
  File "/home/prior/repositories/homeassistant-core/homeassistant/helpers/entity.py", line 1130, in _async_write_ha_state
    self.__async_calculate_state()
  File "/home/prior/repositories/homeassistant-core/homeassistant/helpers/entity.py", line 1067, in __async_calculate_state
    state = self._stringify_state(available)
            ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
  File "/home/prior/repositories/homeassistant-core/homeassistant/helpers/entity.py", line 1011, in _stringify_state
    if (state := self.state) is None:
                 ^^^^^^^^^^
  File "/home/prior/repositories/homeassistant-core/homeassistant/components/device_tracker/config_entry.py", line 238, in state
    if self.latitude is not None and self.longitude is not None:
       ^^^^^^^^^^^^^
  File "/home/prior/repositories/homeassistant-core/config/custom_components/myskoda/device_tracker.py", line 66, in latitude
    position = self._vehicle_position()
               ^^^^^^^^^^^^^^^^^^^^^^^^
  File "/home/prior/repositories/homeassistant-core/config/custom_components/myskoda/device_tracker.py", line 54, in _vehicle_position
    return next(
           ^^^^^
dvx76 commented 9 hours ago

Still happening.

2024-09-28 20:28:59.050 ERROR (MainThread) [custom_components.myskoda.coordinator] Unexpected exception from <bound method MySkodaDataUpdateCoordinator._update_vehicle of <custom_components.myskoda.coordinator.MySkodaDataUpdateCoordinator object at 0x7fe84509b800>>
Traceback (most recent call last):
  File "/home/fdevaux/dev/github/homeassistant-core/config/custom_components/myskoda/coordinator.py", line 185, in _update_vehicle
    self.set_updated_vehicle(vehicle)
  File "/home/fdevaux/dev/github/homeassistant-core/config/custom_components/myskoda/coordinator.py", line 159, in set_updated_vehicle
    self.async_set_updated_data(self.data)
  File "/home/fdevaux/dev/github/homeassistant-core/homeassistant/helpers/update_coordinator.py", line 489, in async_set_updated_data
    self.async_update_listeners()
  File "/home/fdevaux/dev/github/homeassistant-core/homeassistant/helpers/update_coordinator.py", line 168, in async_update_listeners
    update_callback()
  File "/home/fdevaux/dev/github/homeassistant-core/homeassistant/helpers/update_coordinator.py", line 533, in _handle_coordinator_update
    self.async_write_ha_state()
  File "/home/fdevaux/dev/github/homeassistant-core/homeassistant/helpers/entity.py", line 1005, in async_write_ha_state
    self._async_write_ha_state()
  File "/home/fdevaux/dev/github/homeassistant-core/homeassistant/helpers/entity.py", line 1130, in _async_write_ha_state
    self.__async_calculate_state()
  File "/home/fdevaux/dev/github/homeassistant-core/homeassistant/helpers/entity.py", line 1067, in __async_calculate_state
    state = self._stringify_state(available)
            ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
  File "/home/fdevaux/dev/github/homeassistant-core/homeassistant/helpers/entity.py", line 1011, in _stringify_state
    if (state := self.state) is None:
                 ^^^^^^^^^^
  File "/home/fdevaux/dev/github/homeassistant-core/homeassistant/components/device_tracker/config_entry.py", line 238, in state
    if self.latitude is not None and self.longitude is not None:
       ^^^^^^^^^^^^^
  File "/home/fdevaux/dev/github/homeassistant-core/config/custom_components/myskoda/device_tracker.py", line 66, in latitude
    position = self._vehicle_position()
               ^^^^^^^^^^^^^^^^^^^^^^^^
  File "/home/fdevaux/dev/github/homeassistant-core/config/custom_components/myskoda/device_tracker.py", line 54, in _vehicle_position
    return next(
           ^^^^^
StopIteration

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

Traceback (most recent call last):
  File "/home/fdevaux/dev/github/homeassistant-core/homeassistant/helpers/debounce.py", line 137, in _handle_timer_finish
    await task
RuntimeError: coroutine raised StopIteration
dvx76 commented 9 hours ago

Although I think this time my position _is_shared ... {"id":"PARKING_POSITION","statuses":[]}