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

TeslaCar object does not have "vehicle_config" #462

Closed
kbrint opened this issue Mar 27, 2024 · 1 comment
Closed

TeslaCar object does not have "vehicle_config" #462

kbrint opened this issue Mar 27, 2024 · 1 comment

Comments

@kbrint
Copy link
Contributor

kbrint commented Mar 27, 2024

Background

In alandtse/tesla#860 we noticed that a recent change made it impossible to close the trunk via the API.

Follow-up discussion on the pull request alandtse/tesla#868 shows that the problem is likely in teslajsonpy.

Cause

While debugging, we find that the check for .get("vehicle_config",{}).get("plg") in TeslaCar.powered_lift_gate never returns True. It's because self._car never contains a key for vehicle_config.

I think the problem is that the TeslaCar._car only contains the data from the PRODUCT_LIST query. The data stored in my TeslaCar object has the following keys: dict_keys(['id', 'user_id', 'vehicle_id', 'vin', 'color', 'access_type', 'display_name', 'option_codes', 'cached_data', 'granular_access', 'tokens', 'state', 'in_service', 'id_s', 'calendar_enabled', 'api_version', 'backseat_token', 'backseat_token_updated_at', 'ble_autopair_enrolled', 'command_signing'])

Fix

I think the fix for powered_lift_gate is to look for the vehicle_config in the self._vehicle_data dict.

@kbrint
Copy link
Contributor Author

kbrint commented Mar 27, 2024

#463 should fix this.

alandtse added a commit that referenced this issue Mar 27, 2024
fix: Use the correct location for `vehicle_config`.  (#462) (#463)
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

No branches or pull requests

2 participants