bimmerconnected / bimmer_connected

🚘 Library to query the status of your BMW or Mini from the ConnectedDrive portal
Apache License 2.0
365 stars 79 forks source link

Refactor vehicle init #592

Closed rikroe closed 7 months ago

rikroe commented 8 months ago

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.

Based on #591 so that should be merged first.

Type of change

Additional information

Checklist

codecov[bot] commented 8 months ago

Codecov Report

All modified and coverable lines are covered by tests :white_check_mark:

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

Additional details and impacted files ```diff @@ Coverage Diff @@ ## master #592 +/- ## ========================================= Coverage 100.00% 100.00% ========================================= Files 17 17 Lines 1415 1428 +13 ========================================= + Hits 1415 1428 +13 ``` | [Flag](https://app.codecov.io/gh/bimmerconnected/bimmer_connected/pull/592/flags?src=pr&el=flags&utm_medium=referral&utm_source=github&utm_content=comment&utm_campaign=pr+comments&utm_term=bimmerconnected) | Coverage Δ | | |---|---|---| | [3.10](https://app.codecov.io/gh/bimmerconnected/bimmer_connected/pull/592/flags?src=pr&el=flag&utm_medium=referral&utm_source=github&utm_content=comment&utm_campaign=pr+comments&utm_term=bimmerconnected) | `100.00% <100.00%> (ø)` | | | [3.11](https://app.codecov.io/gh/bimmerconnected/bimmer_connected/pull/592/flags?src=pr&el=flag&utm_medium=referral&utm_source=github&utm_content=comment&utm_campaign=pr+comments&utm_term=bimmerconnected) | `100.00% <100.00%> (ø)` | | | [3.12](https://app.codecov.io/gh/bimmerconnected/bimmer_connected/pull/592/flags?src=pr&el=flag&utm_medium=referral&utm_source=github&utm_content=comment&utm_campaign=pr+comments&utm_term=bimmerconnected) | `100.00% <100.00%> (ø)` | | | [3.8](https://app.codecov.io/gh/bimmerconnected/bimmer_connected/pull/592/flags?src=pr&el=flag&utm_medium=referral&utm_source=github&utm_content=comment&utm_campaign=pr+comments&utm_term=bimmerconnected) | `100.00% <100.00%> (ø)` | | | [3.9](https://app.codecov.io/gh/bimmerconnected/bimmer_connected/pull/592/flags?src=pr&el=flag&utm_medium=referral&utm_source=github&utm_content=comment&utm_campaign=pr+comments&utm_term=bimmerconnected) | `100.00% <100.00%> (ø)` | | Flags with carried forward coverage won't be shown. [Click here](https://docs.codecov.io/docs/carryforward-flags?utm_medium=referral&utm_source=github&utm_content=comment&utm_campaign=pr+comments&utm_term=bimmerconnected#carryforward-flags-in-the-pull-request-comment) to find out more.

:umbrella: View full report in Codecov by Sentry.
:loudspeaker: Have feedback on the report? Share it here.

demel42 commented 8 months ago

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 commented 8 months ago

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