skodaconnect / myskoda

Python library for interacting with MySkoda APIs.
MIT License
7 stars 20 forks source link

Octavia NX - Unable to gather get_trip_statistics #192

Closed ThraaxSession closed 2 days ago

ThraaxSession commented 2 days ago

Version: image

2024-11-11 16:46:59.332 ERROR (MainThread) [myskoda.rest_api] Failed to deserialize data: {"vehicleType":"FUEL","detailedStatistics":[{"date":"2024-11-11"},{"date":"2024-11-12"},{"date":"2024-11-13"},{"date":"2024-11-14"},{"date":"2024-11-15"},{"date":"2024-11-16"},{"date":"2024-11-17"}]}
Traceback (most recent call last):
  File "/usr/local/lib/python3.12/site-packages/myskoda/rest_api.py", line 392, in _deserialize
    data = deserialize(text)
           ^^^^^^^^^^^^^^^^^
  File "<string>", line 8, in __mashumaro_from_json__
mashumaro.exceptions.MissingField: Field "overall_average_travel_time_in_min" of type int is missing in TripStatistics instance
2024-11-11 16:46:59.332 ERROR (MainThread) [custom_components.myskoda.coordinator] Unexpected error fetching myskoda data
Traceback (most recent call last):
  File "/usr/src/homeassistant/homeassistant/helpers/update_coordinator.py", line 382, in _async_refresh
    self.data = await self._async_update_data()
                ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
  File "/config/custom_components/myskoda/coordinator.py", line 94, in _async_update_data
    vehicle = await self.myskoda.get_vehicle(self.vin)
              ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
  File "/usr/local/lib/python3.12/site-packages/myskoda/myskoda.py", line 301, in get_vehicle
    vehicle.trip_statistics = await self.get_trip_statistics(vin)
                              ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
  File "/usr/local/lib/python3.12/site-packages/myskoda/myskoda.py", line 262, in get_trip_statistics
    return (await self.rest_api.get_trip_statistics(vin, anonymize=anonymize)).result
            ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
  File "/usr/local/lib/python3.12/site-packages/myskoda/rest_api.py", line 191, in get_trip_statistics
    result = self._deserialize(raw, TripStatistics.from_json)
             ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
  File "/usr/local/lib/python3.12/site-packages/myskoda/rest_api.py", line 392, in _deserialize
    data = deserialize(text)
           ^^^^^^^^^^^^^^^^^
  File "<string>", line 8, in __mashumaro_from_json__
mashumaro.exceptions.MissingField: Field "overall_average_travel_time_in_min" of type int is missing in TripStatistics instance
2024-11-11 16:46:59.333 DEBUG (MainThread) [custom_components.myskoda.coordinator] Finished fetching myskoda data in 7.859 seconds (success: False)
dvx76 commented 2 days ago

Duplicate of skodaconnect/homeassistant-myskoda#219, will be fixed in next release.