Skip to content

fix(gateway): emit ad-hoc command serial under "serial", not "dongle_serial"#4096

Open
mgazza wants to merge 1 commit into
mainfrom
fix/gateway-command-serial-key
Open

fix(gateway): emit ad-hoc command serial under "serial", not "dongle_serial"#4096
mgazza wants to merge 1 commit into
mainfrom
fix/gateway-command-serial-key

Conversation

@mgazza

@mgazza mgazza commented Jun 20, 2026

Copy link
Copy Markdown
Collaborator

Summary

build_command() addresses an inverter by its inverter serial (e.g. CH2330G499), not the WiFi dongle serial (e.g. WJ2330G499). A prior change (aeed2bee) renamed the wire key to dongle_serial to match the gateway firmware struct field, but that mislabels an inverter serial as a dongle serial.

This emits it under serial instead.

  • The gateway resolver matches either the dongle or the inverter serial (command_resolve_target_slots), so resolution is unaffected.
  • The gateway firmware accepts both serial and dongle_serial as the deserialiser key, so this stays compatible while using the honest name.
  • It also matches the serial key the deployed fleet already emits.

Changes

  • apps/predbat/gateway.pybuild_command() emits serial (was dongle_serial), with a comment explaining why the value is an inverter serial so it isn't renamed back.
  • apps/predbat/tests/test_gateway.py — update TestCommandFormat / TestSetChargeSlotPayload expectations to assert the serial key (and that dongle_serial is absent).

Testing

pytest apps/predbat/tests/test_gateway.py180 passed.

…serial"

build_command() addresses an inverter by its *inverter* serial (e.g.
"CH2330G499"), not the WiFi dongle serial (e.g. "WJ2330G499"). A prior
change (aeed2be) renamed the wire key to "dongle_serial" to match the
gateway firmware struct field, but that mislabels an inverter serial as a
dongle serial.

Emit it under "serial" instead. The gateway resolver matches either the
dongle or the inverter serial (command_resolve_target_slots), and the
firmware accepts both "serial" and "dongle_serial" as the deserialiser
key, so this is the honest name and stays compatible. This also matches
the serial key the deployed fleet already emits.

Update the TestCommandFormat / TestSetChargeSlotPayload expectations to
assert the "serial" key (and that "dongle_serial" is absent).

Co-Authored-By: Claude Opus 4.8 (1M context) <noreply@anthropic.com>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant