Skip to content

Gateway, prevent auto-config if filter does not match#4026

Merged
springfall2008 merged 4 commits into
mainfrom
fix/gateway_filter
Jun 8, 2026
Merged

Gateway, prevent auto-config if filter does not match#4026
springfall2008 merged 4 commits into
mainfrom
fix/gateway_filter

Conversation

@springfall2008
Copy link
Copy Markdown
Owner

No description provided.

Copilot AI review requested due to automatic review settings June 7, 2026 22:22
Copy link
Copy Markdown
Contributor

Copilot AI left a comment

Choose a reason for hiding this comment

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

Pull request overview

This PR changes GatewayMQTT auto-configuration behavior so that when gateway_inverter_serial is configured but matches no inverters, the gateway does not proceed with auto-config and instead logs an error and retries on subsequent telemetry. This aims to prevent binding PredBat to an unintended inverter set.

Changes:

  • Update GatewayMQTT.automatic_config() to treat a serial-filter no-match as an error and abort auto-config early.
  • Update gateway unit tests to expect aborted auto-config and an error log when the serial filter matches nothing.

Reviewed changes

Copilot reviewed 2 out of 2 changed files in this pull request and generated 1 comment.

File Description
apps/predbat/gateway.py Aborts auto-config when gateway_inverter_serial matches no inverters, logging an error and returning early.
apps/predbat/tests/test_gateway.py Updates/renames the serial-filter no-match test to assert _auto_configured remains false and num_inverters is not set.

Comment thread apps/predbat/gateway.py Outdated
@springfall2008 springfall2008 merged commit 1e3d3e8 into main Jun 8, 2026
1 check passed
@springfall2008 springfall2008 deleted the fix/gateway_filter branch June 8, 2026 07:10
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