feat(vehicle): add charging/utility signed commands#93
Conversation
Wraps six previously-unimplemented VehicleAction fields: set_rate_tariff, get_rate_tariff, add_managed_charging_site, remove_managed_charging_site, get_managed_charging_sites, and set_discharge_limit (a distinct feature from the existing set_powershare_discharge_limit). set_rate_tariff takes tesla_protocol message types directly for its deeply-nested tariff schedule rather than a parallel flattened API.
58fff73 to
c4a65fe
Compare
There was a problem hiding this comment.
💡 Codex Review
Here are some automated review suggestions for this pull request.
Reviewed commit: c4a65fe71a
ℹ️ About Codex in GitHub
Your team has set up Codex to review pull requests in this repo. Reviews are triggered when you
- Open a pull request for review
- Mark a draft as ready
- Comment "@codex review".
If Codex has suggestions, it will comment; otherwise it will react with 👍.
Codex can also answer questions or update the PR. Try commenting "@codex address that feedback".
| return await self._sendInfotainment( | ||
| Action( | ||
| vehicleAction=VehicleAction(getRateTariffRequest=GetRateTariffRequest()) | ||
| ), | ||
| mutating=False, |
There was a problem hiding this comment.
Return the decoded tariff response
When a vehicle replies to this read with the normal infotainment Response.getRateTariffResponse (and similarly getManagedChargingSitesResponse below), Commands._command only unwraps ping, vehicleData, or actionStatus; otherwise it falls through to {"result": True}. As a result these newly added getter APIs can successfully send the request but discard the tariff/site payload, so callers cannot actually read the data the methods advertise; extend the response decoding for these oneof fields before exposing the getters.
Useful? React with 👍 / 👎.
|
Folded into #91 to avoid serial merge conflicts across the same commands.py regions - closing this in favor of the consolidated PR. |
Intent
CarServer.VehicleActionproto field - this slice covers charging/utility.Commands:set_rate_tariff,get_rate_tariff,add_managed_charging_site,remove_managed_charging_site,get_managed_charging_sites,set_discharge_limit.set_discharge_limitis a distinct feature from the existingset_powershare_discharge_limit(confirmed against the proto:SetDischargeLimitActionvs.SetPowershareDischargeLimitActionare separate messages) - not a duplicate.set_rate_tarifftakestesla_protocolmessage types (SetRateTariffRequest.Seasons/.Tariff) directly as arguments rather than a parallel flattened dataclass API, since the tariff schedule is deeply nested (up to 5 named seasons x 4 time-of-use period types) and this is a niche utility-program feature.tests/test_ble_charging_utility_commands.pycover each command's built signed message over the mocked BLE transport.