Skip to content

Commit

Permalink
Remove deprecated ConnectedDriveAccount/Vehicle (#556)
Browse files Browse the repository at this point in the history
Co-authored-by: rikroe <[email protected]>
  • Loading branch information
rikroe and rikroe authored Aug 10, 2023
1 parent b036c25 commit dac1219
Show file tree
Hide file tree
Showing 12 changed files with 17 additions and 711 deletions.
2 changes: 1 addition & 1 deletion README.rst
Original file line number Diff line number Diff line change
Expand Up @@ -26,7 +26,7 @@ Installation
:code:`bimmer_connected` is tested against **Python 3.7 or above**. Just install the latest release from `PyPI <https://pypi.org/project/bimmer-connected/>`_
using :code:`pip3 install --upgrade bimmer_connected`.

Alteratively, clone the project and execute :code:`pip install -e .` to install the current
Alternatively, clone the project and execute :code:`pip install -e .` to install the current
:code:`master` branch.

Usage
Expand Down
6 changes: 0 additions & 6 deletions bimmer_connected/account.py
Original file line number Diff line number Diff line change
Expand Up @@ -18,7 +18,6 @@
CarBrands,
)
from bimmer_connected.models import AnonymizedResponse, GPSPosition
from bimmer_connected.utils import deprecated
from bimmer_connected.vehicle import MyBMWVehicle

VALID_UNTIL_OFFSET = datetime.timedelta(seconds=10)
Expand Down Expand Up @@ -199,8 +198,3 @@ def refresh_token(self) -> Optional[str]:
def gcid(self) -> Optional[str]:
"""Returns the current GCID."""
return self.config.authentication.gcid


@deprecated("MyBMWAccount")
class ConnectedDriveAccount(MyBMWAccount):
"""Deprecated class name for compatibility."""
2 changes: 1 addition & 1 deletion bimmer_connected/cli.py
Original file line number Diff line number Diff line change
Expand Up @@ -210,7 +210,7 @@ async def vehicle_finder(args) -> None:
vehicle = get_vehicle_or_return(account, args.vin)
status = await vehicle.remote_services.trigger_remote_vehicle_finder()
print(status.state)
print({"gps_position": vehicle.status.gps_position, "heading": vehicle.status.gps_heading})
print({"gps_position": vehicle.vehicle_location.location, "heading": vehicle.vehicle_location.heading})


async def chargingsettings(args) -> None:
Expand Down
13 changes: 1 addition & 12 deletions bimmer_connected/tests/test_account.py
Original file line number Diff line number Diff line change
Expand Up @@ -17,7 +17,7 @@
import pytest
import respx

from bimmer_connected.account import ConnectedDriveAccount, MyBMWAccount
from bimmer_connected.account import MyBMWAccount
from bimmer_connected.api.authentication import MyBMWAuthentication, MyBMWLoginRetry
from bimmer_connected.api.client import MyBMWClient
from bimmer_connected.api.regions import get_region_from_name
Expand All @@ -31,7 +31,6 @@
TEST_REGION_STRING,
TEST_USERNAME,
VIN_G26,
get_deprecation_warning_count,
get_fingerprint_count,
load_response,
)
Expand Down Expand Up @@ -339,16 +338,6 @@ async def test_set_use_metric_units():
assert imperial_client.generate_default_header()["bmw-units-preferences"] == "d=MI;v=G"


@pytest.mark.asyncio
async def test_deprecated_account(caplog, bmw_fixture: respx.Router):
"""Test deprecation warning for ConnectedDriveAccount."""
account = ConnectedDriveAccount(TEST_USERNAME, TEST_PASSWORD, TEST_REGION)
await account.get_vehicles()
assert account is not None

assert 1 == len(get_deprecation_warning_count(caplog))


@pytest.mark.asyncio
async def test_refresh_token_getset(bmw_fixture: respx.Router):
"""Test getting/setting the refresh_token and gcid."""
Expand Down
89 changes: 0 additions & 89 deletions bimmer_connected/tests/test_deprecated_vehicle.py

This file was deleted.

Loading

0 comments on commit dac1219

Please sign in to comment.