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

Refactor vehicle init #592

Merged
merged 5 commits into from
Feb 11, 2024
Merged

Conversation

rikroe
Copy link
Member

@rikroe rikroe commented Jan 21, 2024

Proposed change

Refactor the way we get vehicle data a bit, hopefully to make it clearer and less of an effort to add additional endpoints.

  • Only get base vehicle information in account.py
  • Get vehicle state and further information in vehicle.py
  • Adjust methods to initialize MyBMWVehicle

Based on #591 so that should be merged first.

Type of change

  • Bugfix (non-breaking change which fixes an issue)
  • New feature (which adds functionality to this library)
  • Breaking change (fix/feature causing existing functionality to break)
  • Code quality improvements to existing code or addition of tests

Additional information

  • This PR fixes or closes issue: fixes #
  • This PR is related to issue:

Checklist

  • The code change is tested and works locally.
  • Tests have been added to verify that the new code works.

Copy link

codecov bot commented Jan 21, 2024

Codecov Report

All modified and coverable lines are covered by tests ✅

Comparison is base (5d78330) 100.00% compared to head (6ce2869) 100.00%.

Additional details and impacted files
@@            Coverage Diff            @@
##            master      #592   +/-   ##
=========================================
  Coverage   100.00%   100.00%           
=========================================
  Files           17        17           
  Lines         1415      1428   +13     
=========================================
+ Hits          1415      1428   +13     
Flag Coverage Δ
3.10 100.00% <100.00%> (ø)
3.11 100.00% <100.00%> (ø)
3.12 100.00% <100.00%> (ø)
3.8 100.00% <100.00%> (ø)
3.9 100.00% <100.00%> (ø)

Flags with carried forward coverage won't be shown. Click here to find out more.

☔ View full report in Codecov by Sentry.
📢 Have feedback on the report? Share it here.

@demel42
Copy link

demel42 commented Jan 21, 2024

A hint (from my fast test)

in the function "get_vehicle_image", headers must now also include the entry "bmw-app-vehicle-type" with the value "connected"

return values from the server was

"statusCode":400,"error":"Bad Request","message":["bmw-app-vehicle-type should not be null or undefined","bmw-app-vehicle-type must be one of: connected, demo, non-connected, predelivery"]

i din't use python, so i can't create an pull-request

i think it should bei

headers={"bmw-vin": self.vin, "accept": "image/png", "bmw-app-vehicle-type": "connected"},

@rikroe
Copy link
Member Author

rikroe commented Jan 21, 2024

Many thanks for the quick feedback! Adjusted this in #591 as well, as this is based on it.

@rikroe rikroe force-pushed the refactor-vehicle-init branch from 65143db to a1429fe Compare January 23, 2024 21:03
@rikroe rikroe force-pushed the refactor-vehicle-init branch from a1429fe to 47406dd Compare February 11, 2024 18:19
@rikroe rikroe merged commit 770524a into bimmerconnected:master Feb 11, 2024
13 checks passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants