Repository navigation
Recognize the plug-in hybrid variants in the catalog - #187
Conversation
The catalog gains the plug-in hybrid Volvos (T6 and T8 of the 60 and 90 series, from the XC90 T8 of 2016; T4 and T5 of the XC40) and the Polestar 1, each with a powertrain field. Their gross capacities come from Volvo's manuals, model year by model year; the net ones from public sources where any settles them. A vehicle is matched, offered and chosen among the variants of the powertrain it reads, never one whose powertrain is unknown or other, so that a hybrid's capacity is never taken for an electric's. A variant may have no DC charging: dc_max_kw is null in the API then, and the vehicle's settings say so. Co-Authored-By: Claude Opus 5.5 <[email protected]>
|
Caution Review failedThe pull request is closed.
|
| Layer / File(s) | Summary |
|---|---|
Powertrain and charging-data contract internal/catalog/catalog.go, internal/catalog/validate.go, internal/catalog/catalog_test.go, internal/catalog/validate_test.go |
Variants now carry a validated powertrain. DC charging power may be absent for plug-in hybrids, but remains required for electric variants. Variants with different powertrains are distinguishable. |
Plug-in hybrid catalog entries internal/catalog/variants.yaml, internal/catalog/catalog_test.go |
The catalog adds Volvo plug-in hybrid variants across the listed model years and a Polestar 1 variant, with capacity and charging figures. |
Powertrain-aware matching and API integration internal/catalog/match.go, internal/catalog/match_test.go, internal/api/model.go, internal/api/model_test.go, internal/api/read_test.go, cmd/runsten-collector/capacity.go |
Matching, offering, and chosen variants use the reading’s powertrain. The API and collector pass powertrain readings, and the API represents missing DC charging data as null. |
No-DC display and behavior documentation web/src/features/edit-vehicle-model/ui/VariantLabel.vue, web/src/shared/i18n/locales/*.json, web/test/features/edit-vehicle-model/VehicleModelForm.test.ts, AGENTS.md, documentation/contributing/variants.md, documentation/guide/vehicle-models.md, documentation/self-hosting/updating.md |
The interface displays a localized no-DC label. Documentation describes powertrain-specific recognition, catalog entry fields, and the update note for past events. |
Possibly related issues
- Support plug-in hybrids #165: This change adds the Volvo Recharge and Polestar 1 plug-in hybrid variants and their catalog figures; other hybrid derivation work in the issue is not included.
- Polestar Data Portal as a data source: a Polestar read through its owner's M2M credentials #52: This change adds a recognized Polestar 1 variant, but does not add the Polestar Data Portal source or connection flow.
Possibly related PRs
- runsten-app/runsten#157: Introduced
MatchReadingandReading, which this change extends with powertrain-aware matching. - runsten-app/runsten#180: Introduced snapshot powertrain and plug-in hybrid readings, which this change uses for matching, offers, choices, and capacity selection.
- runsten-app/runsten#163: Added the
net_kwhdisplay path that can use net capacities from the new plug-in hybrid catalog entries.
Pre-merge checks: 
4
-
Full details: Description check
-
Explanation
The description explains the changes, motivation, testing, API impact, localization, and unchecked tests. It is mostly complete, although the template's explicit "Closes #" line is absent and
task unitwas not run.
-
Comment @coderabbitai help to get the list of available commands.
…riants # Conflicts: # AGENTS.md
The catalog's step of plug-in hybrid support: the plug-in hybrid variants, recognized among their own powertrain.
Part of #165 (the catalog's box; the fuel of a trip and the documentation's page follow).
variants.yamlgains apowertrainfield (electricwhen left out,plugin_hybrid) and 20 entries: the XC90 T8 of 9.2 kWh (MY2016–2017), the 10.4 kWh pack (MY2018–2019), the 11.6 kWh one (MY2020–2022), the 18.8 kWh one (from MY2022, on sale) of V60, S60, V90, S90, XC60 and XC90, the XC40 T4/T5 (10.7 kWh) and the Polestar 1.dc_max_kwmay be left out, for a plug-in hybrid only.catalog:Reading.PowertrainreplacesBatteryElectric;Offerlists the variants of the reading's powertrain, family or brand;MatchReading,RecognizeandChosenrest on it.indiscerniblenever pairs two powertrains.offered,effectiveModeland the variants' list read the powertrain. Contract change:dc_max_kwandlevels.dc_max_kware nullable (api/openapi.yaml; no golden file changes).runsten-collector: the net capacities of the derivation follow.How it was tested
go test ./internal/catalog/... ./internal/api/... ./cmd/runsten-collector/... ./internal/archtest/...: new cases for the hybrids' recognition (the API's real values 11.832 and 18.819, MY2022's two packs, a hybrid at an electric's capacity and the reverse, unknown andotherpowertrains, choices across powertrains), the validation (powertrain, DC left out), the API's model and variants list.Mutation: without the powertrain filter in
Offer,TestMatchandTestRecognizefail.task lint,task fmt-check,task web-lint,task web-test. Not run:task lint-api,task integration,task system.task unitpassesThe API's diff (
api/openapi.yaml,internal/api/testdata/) is intended, or there is noneTexts in English, French and Swedish, if the interface changed
No real VIN, token, API key or position, fixtures included
🤖 Generated with Claude Code
Summary by CodeRabbit