Skip to content
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
43 changes: 43 additions & 0 deletions .changeset/energy-registration-enum-typing-and-name-corrections.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,43 @@
---
"@teslemetry/tesla-protocol": major
---

Add energy-device registration types and `Signatures.SessionInfoFlags`, give nine `energy_device` `int32` fields their enum types, make `PartnerInfo.site_relationship_type` repeated, and correct field and type names in `command` and `energy_device`.

Added (wire- and JSON-compatible):

- `energy_device` enums `MarketType`, `RegistrationFailure`, `SiteRegistrationStatus` and `BranchCircuitDeviceType`.
- Enum values `TEGDeviceType` 11 `TULIP`, 12 `DYNAMO` and 13 `SMC_SUPERCHARGER`, `IPMDeviceType` 3 `MEGACHARGER` and `RegistrationDeviceType` 7 `OPTIMUS_CHARGER`.
- Fields `RegistrationRequest.market_type` (12), `RegistrationRequest.potential_site_uuid` (13) and `DeviceDetail.teg_device_type` (4).
- Messages `DeviceInfo`, `AssetSiteDetailsRequest`, `AssetSiteUuidOfDeviceRequest`, `CustomerRegistrationInfo`, `DeactivateDeviceResponse`, `SiteInfo`, `RegistrationRequestWithPartDetails` and `WCCommercialRegistrationRequestWithPartDetails`.
- `command` enum `Signatures.SessionInfoFlags`, which names the bit positions in `SessionInfo.flags`.

**Breaking: `int32` fields now have enum types.** The tags and the wire bytes are the same. Generated code uses the enum types, and JSON output shows enum names instead of numbers:

| Message | Field | New type |
|---|---|---|
| `CommonAPIRegisterResponse` | `failure` (1) | `RegistrationFailure` |
| `RegistrationAPIRegisterResponse` | `failure` (1) | `RegistrationFailure` |
| `CommercialChargingDeviceProperties` | `power_type` (9) | `PowerType` |
| `CommercialChargingDeviceProperties` | `connector_type` (10) | `ConnectorType` |
| `SystemUpdate` | `handshake_result` (1) | `UpdateHandshakeResult` |
| `SystemUpdate` | `update_status` (2) | `UpdateStatus` |
| `SystemUpdate` | `last_update_result` (8) | `LastUpdateResult` |
| `CommonAPIConfigureWifiWithEncryptedPasswordResponse` | `result` (3) | `WifiConfigureResult` |
| `CommonAPIGetCellularInfoResponse` | `supported_profiles` (2) | `repeated CellularProfileType` |

**Breaking: `PartnerInfo.site_relationship_type` (2) is now `repeated RegistrationSiteRelationshipType`.** The wire tag is the same. Generated code and JSON now use a list.

**Breaking: names change.** The tags and the wire bytes are the same:

| Symbol | Before | After | JSON name changes |
|---|---|---|---|
| `Errors.NominalError` field 8 | `keyNotFoundContext` | `keyNotFound`, in `oneof context` | yes |
| `Errors.KeyNotFoundContext` field 1 | `public_key` | `publicKey`, in `oneof key` | no |
| `Errors.KeyNotFoundContext` field 2 | `handle` | `slot`, in `oneof key` | yes |
| `VCSEC.VehicleStatus` field 6 | `uiDesire` | `UIDesire` | yes |
| `energy_device` enum | `iPMDeviceType` | `IPMDeviceType` | no |
| `EncryptedMessage` field 2 | `cipher_text` | `ciphertext` | yes |
| `GridComplianceStatus` field 2 | `qualifiying_time_remaining_s` | `qualifying_time_remaining_s` | yes |
| `WifiNetwork` field 2 | `rssiValue` | `rssi_value` | no |
| `WifiNetwork` field 4 | `securityType` | `security_type` | no |
30 changes: 20 additions & 10 deletions buf.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -24,17 +24,27 @@ breaking:
# trips this rule every time, so it's excepted repo-wide rather than per-PR.
except:
- RESERVED_MESSAGE_NO_DELETE
# Temporary: this major release corrects placeholder and mis-guessed field
# names in command/ (same tags, new names). These rules flag that. Delete this
# block in the first PR after this release is published.
# Temporary: this major release corrects field names (same tags, new names),
# moves fields into oneofs, gives int32 fields their enum types and makes
# PartnerInfo.site_relationship_type repeated. These rules flag that. Delete
# this block in the first PR after this release is published.
ignore_only:
FIELD_SAME_JSON_NAME:
- proto/command/car_server.proto
- proto/command/signatures.proto
- proto/command/vehicle.proto
- proto/command/errors.proto
- proto/command/vcsec.proto
- proto/energy_device/device.proto
- proto/energy_device/energy.proto
FIELD_SAME_NAME:
- proto/command/car_server.proto
- proto/command/signatures.proto
- proto/command/vehicle.proto
- proto/command/errors.proto
- proto/command/vcsec.proto
- proto/energy_device/device.proto
- proto/energy_device/energy.proto
- proto/energy_device/networking.proto
FIELD_SAME_ONEOF:
- proto/command/vehicle.proto
- proto/command/errors.proto
FIELD_WIRE_JSON_COMPATIBLE_TYPE:
- proto/energy_device/common_api.proto
- proto/energy_device/registration_api.proto
- proto/energy_device/update.proto
FIELD_WIRE_JSON_COMPATIBLE_CARDINALITY:
- proto/energy_device/registration_api.proto
6 changes: 3 additions & 3 deletions catalog/SUMMARY.md
Original file line number Diff line number Diff line change
Expand Up @@ -4,15 +4,15 @@ Generated by `scripts/build_catalog.py` from `proto/`. Do not edit by hand;
regenerate with `.venv/bin/python scripts/build_catalog.py` and commit the diff.
See `catalog/catalog.json` for the full descriptor-based inventory.

**Totals:** 41 source files, 7 groups, 1019 messages, 271 enums, 3588 fields.
**Totals:** 41 source files, 7 groups, 1027 messages, 276 enums, 3603 fields.

| Group | Source files | Compiled top-level inputs | Messages | Enums | Fields |
|---|---:|---:|---:|---:|---:|
| `charging` | 1 | 1 | 6 | 0 | 31 |
| `command` | 10 | 10 | 377 | 113 | 1974 |
| `command` | 10 | 10 | 377 | 114 | 1974 |
| `dashcam` | 1 | 1 | 1 | 2 | 16 |
| `energy_command` | 1 | 1 | 0 | 1 | 0 |
| `energy_device` | 22 | 21 | 524 | 104 | 1241 |
| `energy_device` | 22 | 21 | 532 | 108 | 1256 |
| `telemetry` | 5 | 5 | 16 | 48 | 112 |
| `teslapower` | 1 | 1 | 95 | 3 | 214 |

Expand Down
Loading
Loading