Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Validation error for shopGenuinePartsUrl in VehiclesResponseModel #236

Closed
bohmszi opened this issue Feb 12, 2024 · 14 comments · Fixed by #237
Closed

Validation error for shopGenuinePartsUrl in VehiclesResponseModel #236

bohmszi opened this issue Feb 12, 2024 · 14 comments · Fixed by #237
Assignees
Labels

Comments

@bohmszi
Copy link

bohmszi commented Feb 12, 2024

Describe the bug
Home Assistant integration fails with the error included in Additional Context
All my sensors are in Unknown state

To Reproduce
Issue happened after update of ha_toyota integration on 2/11/2014.
Last commit ID: 26110c9
Home Assistant Core 2024.1.3
Frontend 20240104.0

Expected behavior
Integration should pull the data from Toyota API.

Additional context

2024-02-12 15:32:10 ERROR Unexpected error fetching toyota data: 1 validation error for VehiclesResponseModel

payload -> 0 -> shopGenuinePartsUrl

  none is not an allowed value (type=type_error.none.not_allowed)

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 "/usr/src/homeassistant/homeassistant/helpers/update_coordinator.py", line 256, in _async_update_data

    return await self.update_method()

           ^^^^^^^^^^^^^^^^^^^^^^^^^^

  File "/config/custom_components/toyota/__init__.py", line 71, in async_get_vehicle_data

    vehicles = await asyncio.wait_for(client.get_vehicles(metric=use_metric_values), 15)

               ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^

  File "/usr/local/lib/python3.11/asyncio/tasks.py", line 489, in wait_for

    return fut.result()

           ^^^^^^^^^^^^

  File "/usr/local/lib/python3.11/site-packages/mytoyota/client.py", line 64, in get_vehicles

    vehicles = await self._api.get_vehicles_endpoint()

               ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^

  File "/usr/local/lib/python3.11/site-packages/mytoyota/api.py", line 81, in get_vehicles_endpoint

    parsed_response = await self._request_and_parse(

                      ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^

  File "/usr/local/lib/python3.11/site-packages/mytoyota/api.py", line 55, in _request_and_parse

    return model(**response)

           ^^^^^^^^^^^^^^^^^

  File "pydantic/main.py", line 341, in pydantic.main.BaseModel.__init__

pydantic.error_wrappers.ValidationError: 1 validation error for VehiclesResponseModel

payload -> 0 -> shopGenuinePartsUrl

  none is not an allowed value (type=type_error.none.not_allowed)
@zebde
Copy link

zebde commented Feb 12, 2024

I am now getting this too on HA 2024.2.1 and v2.0.1 of the component.

@Mauribel
Copy link

+1

2 similar comments
@attree
Copy link

attree commented Feb 12, 2024

+1

@vix66
Copy link

vix66 commented Feb 12, 2024

+1

@amastrogiacomo1968
Copy link

Same problem on Home Assistant 2024.02.1

@oskarhood
Copy link

+1

1 similar comment
@raudraido
Copy link

+1

@thomasattree
Copy link

This is the upstream PR for this in the mytoyota package. DurgNomis-drol/mytoyota#331

@Chobnob
Copy link

Chobnob commented Feb 13, 2024

I am also getting this exact validation error. Post the error I loaded the Toyota app and it required me to agree to altered T&Cs before I could proceed. I did and logged onto the app successfully. However this did not unlock the HA add on. It may be coincidental but I suspect Toyota changed the logon routines.
I am running 2024.02.1 but same error on a 2024.01.5 backup system.

@CM000n
Copy link
Collaborator

CM000n commented Feb 13, 2024

There is already a fix in place, that just has to be approved: #237

This has nothing to do with a changed logon process. They have updated the API content (again) and now some information is missing which before was always delivered.

@CM000n CM000n changed the title Validation error for VehiclesResponseModel shopGenuinePartsUrl Validation error for shopGenuinePartsUrl in VehiclesResponseModel Feb 14, 2024
@AlfredVossen
Copy link

Same problem with Core v.2024.1.5 : All entities unavailable.
Same problem after Update Toyota Connected Services from 2.0.0 → 2.0.1 on 13-02-2024 -> still All entities unavailable.

@ajain-93
Copy link

ajain-93 commented Feb 15, 2024

I was a little bit impatient for the fix to be released in the main branch/hacs and implemented it manually on my install.

In the file hass_config/custom_components/toyota/manifest.json change the last few lines from:

  "requirements": [
    "mytoyota==2.0.0",
    "arrow"
  ],
  "version": "2.0.1"
}

to:

  "requirements": [
    "mytoyota==2.1.0",
    "arrow"
  ],
  "version": "2.0.2"
}

Don't forget to restart HASS to reload the new dependencies.

@peluho
Copy link

peluho commented Feb 15, 2024

I was a little bit impatient for the fix to be released in the main branch/hacs and implemented it manually on my install.

In the file hass_config/custom_components/toyota/manifest.json change the last few lines from:

  "requirements": [
    "mytoyota==2.0.0",
    "arrow"
  ],
  "version": "2.0.1"
}

to:

  "requirements": [
    "mytoyota==2.1.0",
    "arrow"
  ],
  "version": "2.0.2"
}

Don't forget to restart HASS to reload the new dependencies.

thanks a lot

It worked, it seems than the plate is now gone from the new API?

cheers,

@AlfredVossen
Copy link

AlfredVossen commented Feb 15, 2024 via email

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Projects
None yet
Development

Successfully merging a pull request may close this issue.