thomasnordquist / MQTT-Explorer

An all-round MQTT client that provides a structured topic overview
https://mqtt-explorer.com
Other
3.09k stars 291 forks source link

feat: add sparkplug b encoder for publishing #655

Open ferm10n opened 2 years ago

ferm10n commented 2 years ago

Continuing off the work of https://github.com/thomasnordquist/MQTT-Explorer/pull/629 and https://github.com/thomasnordquist/MQTT-Explorer/pull/582, this PR adds the ability to publish sparkplug B payloads.

I'm looking for input on the method used for determining when to encode (checking if the topic is sparkplug like via regex) and how error handling should be done when the format is incorrect (currently a no-op)

ferm10n commented 2 years ago

Also I should mention that I fixed the linting step in CI. I hope that was ok. Doing so exposed a warning in an unrelated file, that I'm not sure how to address.

bj00rn commented 6 months ago

@ferm10n Can you rebase this, and hopefully we can get it merged?

ferm10n commented 6 months ago

@bj00rn ready for review.

I did have a question about https://github.com/thomasnordquist/MQTT-Explorer/pull/655/files#diff-5255694efe3f339a40eef198ab371f5c050b53e65146bb32aa2dbb2427646beaR39, did you have a preference on how to handle an error when trying to encode a sparkplug payload (for example when the user provides a payload that cannot be sparkplug encoded)

bj00rn commented 6 months ago

@ferm10n thanks for this, I think we have to sort out decoding/encoding logic before looking into this there are a few issues/pr around this ATM