Skip to content

Fix gateway to use inverter ID - #3777

Merged
springfall2008 merged 5 commits into
mainfrom
fix/gateway_id
Apr 11, 2026
Merged

springfall2008 merged 5 commits into
mainfrom
fix/gateway_id

Conversation

@springfall2008

Copy link
Copy Markdown
Owner

No description provided.

Copilot AI review requested due to automatic review settings April 11, 2026 09:17

Copilot AI left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Pull request overview

Updates the ESP32 Gateway MQTT integration to include the inverter serial in control commands by deriving it from the entity ID suffix, aligning command routing with multi-inverter setups.

Changes:

  • Track a mapping of entity suffix → full inverter serial during automatic_config().
  • Include serial in JSON command payloads for select/number/switch-driven gateway commands.
  • Add unit tests for build_command() serial handling and update gateway test fixtures to include _suffix_to_serial.

Reviewed changes

Copilot reviewed 3 out of 3 changed files in this pull request and generated 3 comments.

File Description
apps/predbat/gateway.py Adds suffix→serial mapping, entity_id→serial extraction, and forwards serial into published commands / command payload JSON.
apps/predbat/tests/test_gateway.py Adds/adjusts tests and fixtures to cover command payload serial behavior and new instance state.
.cspell/custom-dictionary-workspace.txt Adds “mpxn” to project spelling dictionary.

Comment thread apps/predbat/gateway.py Outdated
Comment thread apps/predbat/gateway.py
Comment thread apps/predbat/gateway.py
springfall2008 and others added 3 commits April 11, 2026 10:42
Co-authored-by: Copilot <175728472+Copilot@users.noreply.github.com>
@springfall2008
springfall2008 merged commit 56751b7 into main Apr 11, 2026
1 check passed
@springfall2008
springfall2008 deleted the fix/gateway_id branch April 11, 2026 10:36
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.

2 participants