feat(node-red): add seat cooling, preconditioning max, climate keeper, bioweapon commands - #94
Conversation
…, bioweapon commands Wraps the existing @teslemetry/api setSeatCooler/setPreconditioningMax/ setClimateKeeperMode/setBioweaponDefenseMode methods with Command node switch cases and matching editor dropdown options.
There was a problem hiding this comment.
💡 Codex Review
Here are some automated review suggestions for this pull request.
Reviewed commit: f0e9a7ccbb
ℹ️ 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".
| @@ -0,0 +1,5 @@ | |||
| --- | |||
| "node-red-contrib-teslemetry": minor | |||
There was a problem hiding this comment.
Use the scoped package name in the changeset
When Changesets processes this entry, this key does not match any workspace package: packages/node-red-contrib-teslemetry/package.json declares @teslemetry/node-red-contrib-teslemetry, and prior changesets use that scoped name. Consequently the versioning step will reject the unknown package instead of producing the minor bump, blocking the release workflow until the frontmatter uses the exact scoped name.
Useful? React with 👍 / 👎.
| integer: true, | ||
| }, | ||
| }); | ||
| result = await vehicle.setSeatCooler(msg.seat, msg.level); |
There was a problem hiding this comment.
Normalize validated numeric inputs before calling the SDK
When a flow supplies numeric strings—for example msg.level as "2" or msg.mode as "1"—validateParameters accepts them because it validates Number(value), but this call and the new climate-keeper call forward the original strings. The SDK's JSON serializer preserves those strings even though the generated request types require numeric values, so otherwise validator-approved messages can be rejected by these endpoints; either pass the converted numbers or reject non-number inputs.
Useful? React with 👍 / 👎.
…s before SDK calls - .changeset used the unscoped "node-red-contrib-teslemetry" name; the package is published as "@teslemetry/node-red-contrib-teslemetry", so changesets' versioning step would reject it. - setSeatCooler/setClimateKeeperMode forwarded msg.level/msg.mode as received - validateParameters accepts numeric strings (e.g. "2") but never coerces them, so a numeric-string payload reached the SDK call untouched. Wrap both in Number() after validation. - Add the node-red package's first test suite (tsx --test, matching the other packages' convention) covering the two coercions above.
Intent
node-red-contrib-teslemetry's Command node: expose four climate commands that@teslemetry/apialready implements but the node's switch-case didn't wrap yet.setSeatCooler-> newsetSeatCoolercase (msg.seatfront_left/front_right,msg.level0-3).setPreconditioningMax->setPreconditioningMaxOn/Offcases (msg.manualOverride, defaultfalse).setClimateKeeperMode-> newsetClimateKeeperModecase (msg.mode0-3).setBioweaponDefenseMode->setBioweaponDefenseModeOn/Offcases (msg.manualOverride, defaultfalse).setSentryModeOn/Off.TeslemetryVehicleApi.