Skip to content

Consumer: fix set data validation - #4138

Merged
LKuemmel merged 3 commits into
openWB:masterfrom
LKuemmel:fixes
Oct 19, 2026
Merged

LKuemmel merged 3 commits into
openWB:masterfrom
LKuemmel:fixes

Conversation

@LKuemmel

Copy link
Copy Markdown
Contributor

Ticket #66009300

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.

🟡 Changes recommended

Unresolved initialization timing, configuration gating, and malformed-topic handling issues remain.

2 open issues
What changed in this PR

Updates consumer initialization and set-topic validation to handle configured IDs and publish initial consumer data directly.

Changes:

  • Adds consumer existence and topic validation.
  • Publishes new-consumer defaults to canonical topics.
  • Updates the corresponding command test expectation.
File Summary
packages/​helpermodules/​setdata.py Adjusts consumer validation and unknown-ID handling.
packages/​helpermodules/​command.py Publishes initial consumer data directly.
packages/​helpermodules/​command_test.py Updates the expected usage topic.

Review effort: Lite

Comment on lines +1263 to 1264
elif re.search("openWB/set/consumer/[0-9]+/config$", msg.topic) is not None:
self._validate_value(msg, "json")
self._validate_value(msg, int, [(0, 3)])
elif re.search("consumer/[0-9]+/control_parameter/", msg.topic) is not None:
self.process_control_parameter_topics(msg)
elif subdata.SubData.consumer_data.get(f"consumer{get_index(msg.topic)}"):
@LKuemmel
LKuemmel merged commit 7ee6d42 into openWB:master Oct 19, 2026
1 check passed
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