Skip to content
This repository was archived by the owner on Mar 9, 2026. It is now read-only.

Commit fb2d2af

Browse files
authored
Add error message to code (#755)
1 parent d4e40fb commit fb2d2af

5 files changed

Lines changed: 11 additions & 8 deletions

File tree

bimmer_connected/account.py

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -23,6 +23,8 @@
2323

2424
_LOGGER = logging.getLogger(__name__)
2525

26+
_LOGGER.error("'bimmer_connected' is non-functional due to changes in the MyBMW API.")
27+
2628

2729
@dataclass
2830
class MyBMWAccount:

bimmer_connected/tests/test_account.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -750,7 +750,7 @@ async def test_client_async_only(bmw_fixture: respx.Router):
750750
with httpx.Client(
751751
auth=MyBMWAuthentication(TEST_USERNAME, TEST_PASSWORD, TEST_REGION, hcaptcha_token=TEST_CAPTCHA)
752752
) as client, pytest.raises(RuntimeError):
753-
client.get("/eadrax-ucs/v1/presentation/oauth/config")
753+
client.get("/eadrax-ucs/v1/presentation/oauth/config") # noqa: ASYNC212
754754

755755
with httpx.Client(auth=MyBMWLoginRetry()) as client, pytest.raises(RuntimeError):
756756
client.get("/eadrax-ucs/v1/presentation/oauth/config")

bimmer_connected/tests/test_cli.py

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -160,7 +160,7 @@ def test_oauth_store_credentials(cli_home_dir: Path, bmw_fixture: respx.Router):
160160
assert set(oauth_storage.keys()) == {"access_token", "refresh_token", "gcid", "session_id", "session_id_timestamp"}
161161

162162

163-
@time_machine.travel("2021-11-28 21:28:59 +0000")
163+
@time_machine.travel("2021-11-28 21:28:59+00:00")
164164
@pytest.mark.usefixtures("cli_home_dir")
165165
def test_oauth_load_credentials(cli_home_dir: Path, bmw_fixture: respx.Router):
166166
"""Test loading and storing the oauth credentials."""
@@ -196,7 +196,7 @@ def test_oauth_load_credentials(cli_home_dir: Path, bmw_fixture: respx.Router):
196196
assert oauth_storage["session_id"] == demo_oauth_data["session_id"]
197197

198198

199-
@time_machine.travel("2021-11-28 21:28:59 +0000")
199+
@time_machine.travel("2021-11-28 21:28:59+00:00")
200200
@pytest.mark.usefixtures("cli_home_dir")
201201
def test_oauth_load_credentials_old_session_id(cli_home_dir: Path, bmw_fixture: respx.Router):
202202
"""Test loading and storing the oauth credentials and getting a new session_id."""
@@ -206,7 +206,7 @@ def test_oauth_load_credentials_old_session_id(cli_home_dir: Path, bmw_fixture:
206206
"refresh_token": "demo_refresh_token",
207207
"gcid": "demo_gcid",
208208
"session_id": "demo_session_id",
209-
"session_id_timestamp": 1636838939, # 2021-11-13 21:28:59 +0000
209+
"session_id_timestamp": 1636838939, # 2021-11-13 21:28:59+00:00
210210
}
211211

212212
(cli_home_dir / ".bimmer_connected.json").write_text(json.dumps(demo_oauth_data))
@@ -228,7 +228,7 @@ def test_oauth_load_credentials_old_session_id(cli_home_dir: Path, bmw_fixture:
228228
assert oauth_storage["session_id_timestamp"] == pytest.approx(time.time(), abs=5)
229229

230230

231-
@time_machine.travel("2021-11-28 21:28:59 +0000")
231+
@time_machine.travel("2021-11-28 21:28:59+00:00")
232232
@pytest.mark.usefixtures("cli_home_dir")
233233
def test_oauth_store_credentials_on_error(cli_home_dir: Path, bmw_fixture: respx.Router):
234234
"""Test loading and storing the oauth credentials, even if a call errors out."""

bimmer_connected/tests/test_vehicle_status.py

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -171,7 +171,7 @@ async def test_range_electric(caplog, bmw_fixture: respx.Router):
171171
assert len(get_deprecation_warning_count(caplog)) == 0
172172

173173

174-
@time_machine.travel("2021-11-28 21:28:59 +0000")
174+
@time_machine.travel("2021-11-28 21:28:59+00:00")
175175
@pytest.mark.asyncio
176176
async def test_charging_end_time(caplog, bmw_fixture: respx.Router):
177177
"""Test charging end time."""
@@ -186,7 +186,7 @@ async def test_charging_end_time(caplog, bmw_fixture: respx.Router):
186186
assert len(get_deprecation_warning_count(caplog)) == 0
187187

188188

189-
@time_machine.travel("2021-11-28 17:28:59 +0000")
189+
@time_machine.travel("2021-11-28 17:28:59+00:00")
190190
@pytest.mark.asyncio
191191
async def test_plugged_in_waiting_for_charge_window(caplog, bmw_fixture: respx.Router):
192192
"""I01_REX is plugged in but not charging, as its waiting for charging window."""
@@ -477,7 +477,7 @@ async def test_tires(bmw_fixture: respx.Router):
477477
assert tires.rear_left.season == 2
478478

479479

480-
@time_machine.travel("2021-11-28 21:28:59 +0000")
480+
@time_machine.travel("2021-11-28 21:28:59+00:00")
481481
@pytest.mark.asyncio
482482
async def test_climate(bmw_fixture: respx.Router):
483483
"""Test climate status."""

pyproject.toml

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -51,6 +51,7 @@ ignore = [
5151
"D100", # Missing docstring in public module
5252
"D105", # Missing docstring in magic method
5353
"D107", # Missing docstring in `__init__`
54+
"FURB171", # Membership test against single-item container
5455
"PLR0913", # Too many arguments in function definition
5556
"PLR2004", # Magic value used in comparison
5657
"PLW1641", # Object does not implement `__hash__` method

0 commit comments

Comments
 (0)