Adapted the custom mqtt convertor for default mqtt config#2005
Merged
samson0v merged 2 commits intothingsboard:masterfrom Nov 11, 2025
Merged
Conversation
Member
Andry925
commented
Oct 30, 2025
- Fixed the custom mqtt convertor by adding timestamp to telemetries and adapt it for default mqtt config.
samson0v
requested changes
Nov 11, 2025
| TelemetryEntry({datapoint_key: value}) # creating telemetry entry | ||
| converted_data.add_to_telemetry(datapoint_key) # adding telemetry entry to telemetry array for sending data to platform | ||
| for _ in range(self.__config[extension_config_key][telemetry_key]): | ||
| try:# reading every value with value length from config |
Contributor
There was a problem hiding this comment.
Move this comment below and follow PEP8!
| for _ in range(self.__config[extension_config_key][telemetry_key]): | ||
| try:# reading every value with value length from config | ||
| value = converted_bytes.pop(0) | ||
| except Exception as e: |
Contributor
There was a problem hiding this comment.
Do we need this e variable here? Do we use this variable next?
| continue | ||
| # process and remove byte from processing | ||
| datapoint_key = TBUtility.convert_key_to_datapoint_key(telemetry_key.replace("Bytes", ""), None, {}, self._log) # creating telemetry entry | ||
| converted_data.add_to_telemetry(TelemetryEntry({datapoint_key: value}, ts=timestamp)) # adding telemetry entry to telemetry array for sending data to platform |
Contributor
There was a problem hiding this comment.
If len(self.__config[extension_config_key][telemetry_key]) == 0, what will happen to the value variable?
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.