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

Fix driving range model for Octavia NX #163

Merged
merged 2 commits into from
Nov 8, 2024
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.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
1 change: 1 addition & 0 deletions fixtures/nx53l5_octavia_2024_combi_deepsleep_0.8.3.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -480,6 +480,7 @@ reports:
"gasoline", "currentSoCInPercent": 100, "currentFuelLevelInPercent": 100, "remainingRangeInKm":
820}, "carCapturedTimestamp": "2024-10-21T06:57:30Z"}'
result:
ad_blue_range: null
car_captured_timestamp: '2024-10-21T06:57:30+00:00'
car_type: gasoline
primary_engine_range:
Expand Down
1 change: 1 addition & 0 deletions fixtures/prior99_enyaq_iv60_idle_full_battery.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -502,6 +502,7 @@ reports:
"electric", "currentSoCInPercent": 47, "remainingRangeInKm": 153}, "carCapturedTimestamp":
"2024-10-14T16:15:14Z"}'
result:
ad_blue_range: null
car_captured_timestamp: '2024-10-14T16:15:14+00:00'
car_type: electric
primary_engine_range:
Expand Down
1 change: 1 addition & 0 deletions fixtures/prior99_octavia_2018.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -363,6 +363,7 @@ reports:
"diesel", "currentSoCInPercent": 81, "currentFuelLevelInPercent": 81, "remainingRangeInKm":
530}, "carCapturedTimestamp": "2024-10-16T17:46:58Z"}'
result:
ad_blue_range: null
car_captured_timestamp: '2024-10-16T17:46:58+00:00'
car_type: diesel
primary_engine_range:
Expand Down
1 change: 1 addition & 0 deletions fixtures/skoda_octavia_combi_2023.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -438,6 +438,7 @@ reports:
"gasoline", "currentSoCInPercent": 100, "currentFuelLevelInPercent": 100, "remainingRangeInKm":
830}, "carCapturedTimestamp": "2024-11-06T11:38:26Z"}'
result:
ad_blue_range: null
car_captured_timestamp: '2024-11-06T11:38:26+00:00'
car_type: gasoline
primary_engine_range:
Expand Down
1 change: 1 addition & 0 deletions fixtures/superb_iv_2020_3v35xc_liftback_l_and_k.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -499,6 +499,7 @@ reports:
850}, "secondaryEngineRange": {"engineType": "electric", "currentSoCInPercent":
63, "remainingRangeInKm": 23}, "carCapturedTimestamp": "2024-10-16T17:40:53Z"}'
result:
ad_blue_range: null
car_captured_timestamp: '2024-10-16T17:40:53+00:00'
car_type: hybrid
primary_engine_range:
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -496,6 +496,7 @@ reports:
"electric", "currentSoCInPercent": 34, "remainingRangeInKm": 138}, "carCapturedTimestamp":
"2024-10-21T14:50:39Z"}'
result:
ad_blue_range: null
car_captured_timestamp: '2024-10-21T14:50:39+00:00'
car_type: electric
primary_engine_range:
Expand Down
5 changes: 4 additions & 1 deletion myskoda/models/driving_range.py
Original file line number Diff line number Diff line change
Expand Up @@ -29,8 +29,11 @@ class EngineRange(DataClassORJSONMixin):
class DrivingRange(DataClassORJSONMixin):
car_captured_timestamp: datetime = field(metadata=field_options(alias="carCapturedTimestamp"))
car_type: EngineType = field(metadata=field_options(alias="carType"))
total_range_in_km: int = field(metadata=field_options(alias="totalRangeInKm"))
primary_engine_range: EngineRange = field(metadata=field_options(alias="primaryEngineRange"))
secondary_engine_range: EngineRange | None = field(
default=None, metadata=field_options(alias="secondaryEngineRange")
)
total_range_in_km: int | None = field(
default=None, metadata=field_options(alias="totalRangeInKm")
)
ad_blue_range: int | None = field(default=None, metadata=field_options(alias="adBlueRange"))