You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
fix(iobroker): reconcile rejected vehicle/energy writes instead of leaving state looking applied (#124)
handleStateChange() in VehicleHandler/EnergyHandler used to catch and log
its own write failures, so the onStateChange() caller in main.ts never saw
the rejection and the object state kept showing the requested value as if
it had applied. Writes now go through a writeAndReconcile() helper that
acks the requested value on success and restores the last confirmed value
on failure, letting the failure propagate to onStateChange() as the single
place that logs it.
Reconcile rejected vehicle/energy writes instead of leaving the object state showing the requested value as applied: `VehicleHandler`/`EnergyHandler` now let write failures propagate to `onStateChange()` (the single place that logs and reports the error) and restore the last confirmed value on the failed state, while a successful write now explicitly acks the new value.
Copy file name to clipboardExpand all lines: AGENTS.md
+2Lines changed: 2 additions & 0 deletions
Display the source diff
Display the rich diff
Original file line number
Diff line number
Diff line change
@@ -168,6 +168,8 @@ pnpm link --global n8n-nodes-teslemetry
168
168
169
169
**Gotcha**: the `HvacLeft`/`HvacRightTemperatureRequest` SSE signals and `TeslemetryVehicleApi.setTemps()`'s positional args are physical left/right seats, not driver/passenger - on RHD vehicles the driver sits on the right. `StateManager` stores each vehicle's `config.rhd` (from `VehicleDetails.metadata`, passed in at `createVehicleStates()`) and exposes it via `isRhd(vin)`, which both the SSE mapping in `updateVehicleDataFromSignals` and the `setTemps()` write in `VehicleHandler.handleStateChange` consult to pick the correct side - mirrors the Homebridge plugin's `ClimateService.isRHD` pattern.
170
170
171
+
**Gotcha**: `VehicleHandler`/`EnergyHandler.handleStateChange()` don't catch their own write failures - a rejected SDK write propagates up to `main.ts`'s `onStateChange()`, the single place that logs it, so a new write branch must not add its own catch/log or the failure logs twice. Each write goes through `writeAndReconcile(id, value, write)` (private to each handler), which acks the requested value on success and re-acks the last confirmed value on failure, so a rejected command never leaves the ioBroker object state looking like it applied.
172
+
171
173
**Gotcha**: changesets bumps `package.json`/`CHANGELOG.md` on release but never touches `io-package.json` - its `common.version` and `common.news` need a manual sync on every release or the ioBroker repochecker hard-fails submission to `ioBroker.repositories`. No Teslemetry brand/logo asset lives in this monorepo; the real logo mark lives in the separate `website3` repo (its `public/web-app-manifest-512x512.png` is the highest-res copy) - source icons from there, don't hand-draw a placeholder.
0 commit comments