Add vehicle charging & battery flow automation suite#13
Merged
Conversation
Adds the curated B1 set of vehicle charging flow cards: triggers for charging started/stopped/complete, plugged in/unplugged, battery dropping below a configurable percentage, and reaching the charge limit; conditions for is-charging and is-plugged-in; and actions to start/stop charging and set the charge limit and charging amps. Triggers fire off real DetailedChargeState/measure_battery transitions (old != new), following the same explicit trigger-firing pattern R1 established for the *_changed cards - branching per transition where a single capability comparison can't express it, and gating threshold triggers with a registerRunListener state comparison for their per-flow-card percentage argument. Actions call the existing SDK commands directly.
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Intent
battery_levelcondition (it filters onmeasure_battery, which vehicles already have)*_changedcards, extended for cases a single capability comparison can't express:DetailedChargeStatetransitions fan out to several differently-named cards (charging_started/charging_complete/charging_stopped/plugged_in/unplugged) depending on the specific old->new transition, tracked via a private field since "plugged in" has no capability of its ownbattery_belowcarries a per-flow-card percentage argument, so it fires on every real battery change with{previous, current}state and aregisterRunListenerinapp.tsdecides whether that specific card's threshold was crossed;charge_limit_reachedhas no argument, so the crossing check happens directly in the device@teslemetry/apiSDK commands (startCharging,stopCharging,setChargeLimit,setChargingAmps) already used by the capability listeners - no new SDK surfacetest/vehicle-charging-flow.test.tscovering fire/no-fire for every trigger, the two conditions, and all four actionsAGENTS.mdfor future flow-card work