Repository navigation
Consumer: fix set data validation - #4138
Merged
Merged
Conversation
Contributor
There was a problem hiding this comment.
🟡 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)}"): |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.

Ticket #66009300