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

Update vehicle to 2.2.0 #103545

Merged
merged 1 commit into from
Nov 6, 2023
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Jump to
Jump to file
Failed to load files.
Diff view
Diff view
4 changes: 1 addition & 3 deletions homeassistant/components/rdw/diagnostics.py
Original file line number Diff line number Diff line change
@@ -1,7 +1,6 @@
"""Diagnostics support for RDW."""
from __future__ import annotations

import json
from typing import Any

from vehicle import Vehicle
Expand All @@ -18,6 +17,5 @@ async def async_get_config_entry_diagnostics(
) -> dict[str, Any]:
"""Return diagnostics for a config entry."""
coordinator: DataUpdateCoordinator[Vehicle] = hass.data[DOMAIN][entry.entry_id]
# Round-trip via JSON to trigger serialization
data: dict[str, Any] = json.loads(coordinator.data.json())
data: dict[str, Any] = coordinator.data.to_dict()
return data
2 changes: 1 addition & 1 deletion homeassistant/components/rdw/manifest.json
Original file line number Diff line number Diff line change
Expand Up @@ -7,5 +7,5 @@
"integration_type": "service",
"iot_class": "cloud_polling",
"quality_scale": "platinum",
"requirements": ["vehicle==2.0.0"]
"requirements": ["vehicle==2.2.0"]
}
2 changes: 1 addition & 1 deletion requirements_all.txt
Original file line number Diff line number Diff line change
Expand Up @@ -2664,7 +2664,7 @@ uvcclient==0.11.0
vallox-websocket-api==4.0.2

# homeassistant.components.rdw
vehicle==2.0.0
vehicle==2.2.0

# homeassistant.components.velbus
velbus-aio==2023.10.2
Expand Down
2 changes: 1 addition & 1 deletion requirements_test_all.txt
Original file line number Diff line number Diff line change
Expand Up @@ -1982,7 +1982,7 @@ uvcclient==0.11.0
vallox-websocket-api==4.0.2

# homeassistant.components.rdw
vehicle==2.0.0
vehicle==2.2.0

# homeassistant.components.velbus
velbus-aio==2023.10.2
Expand Down
4 changes: 2 additions & 2 deletions tests/components/rdw/conftest.py
Original file line number Diff line number Diff line change
Expand Up @@ -38,7 +38,7 @@ def mock_rdw_config_flow() -> Generator[None, MagicMock, None]:
"homeassistant.components.rdw.config_flow.RDW", autospec=True
) as rdw_mock:
rdw = rdw_mock.return_value
rdw.vehicle.return_value = Vehicle.parse_raw(load_fixture("rdw/11ZKZ3.json"))
rdw.vehicle.return_value = Vehicle.from_json(load_fixture("rdw/11ZKZ3.json"))
yield rdw


Expand All @@ -49,7 +49,7 @@ def mock_rdw(request: pytest.FixtureRequest) -> Generator[None, MagicMock, None]
if hasattr(request, "param") and request.param:
fixture = request.param

vehicle = Vehicle.parse_raw(load_fixture(fixture))
vehicle = Vehicle.from_json(load_fixture(fixture))
with patch("homeassistant.components.rdw.RDW", autospec=True) as rdw_mock:
rdw = rdw_mock.return_value
rdw.vehicle.return_value = vehicle
Expand Down
50 changes: 25 additions & 25 deletions tests/components/rdw/snapshots/test_diagnostics.ambr
Original file line number Diff line number Diff line change
@@ -1,30 +1,30 @@
# serializer version: 1
# name: test_diagnostics
dict({
'apk_expiration': '2022-01-04',
'ascription_date': '2021-11-04',
'ascription_possible': True,
'brand': 'Skoda',
'energy_label': 'A',
'engine_capacity': 999,
'exported': False,
'first_admission': '2013-01-04',
'interior': 'hatchback',
'last_odometer_registration_year': 2021,
'liability_insured': False,
'license_plate': '11ZKZ3',
'list_price': 10697,
'mass_driveable': 940,
'mass_empty': 840,
'model': 'Citigo',
'number_of_cylinders': 3,
'number_of_doors': 0,
'number_of_seats': 4,
'number_of_wheelchair_seats': 0,
'number_of_wheels': 4,
'odometer_judgement': 'Logisch',
'pending_recall': False,
'taxi': None,
'vehicle_type': 'Personenauto',
'aantal_cilinders': 3,
'aantal_deuren': 0,
'aantal_rolstoelplaatsen': 0,
'aantal_wielen': 4,
'aantal_zitplaatsen': 4,
'catalogusprijs': 10697,
'cilinderinhoud': 999,
'datum_eerste_toelating': '20130104',
'datum_tenaamstelling': '20211104',
'export_indicator': 'Nee',
'handelsbenaming': 'Citigo',
'inrichting': 'hatchback',
'jaar_laatste_registratie_tellerstand': 2021,
'kenteken': '11ZKZ3',
'massa_ledig_voertuig': 840,
'massa_rijklaar': 940,
'merk': 'Skoda',
'openstaande_terugroepactie_indicator': 'Nee',
'taxi_indicator': None,
'tellerstandoordeel': 'Logisch',
'tenaamstellen_mogelijk': 'Ja',
'vervaldatum_apk': '20220104',
'voertuigsoort': 'Personenauto',
'wam_verzekerd': 'Nee',
'zuinigheidslabel': 'A',
})
# ---