diff --git a/ChangeLog.txt b/ChangeLog.txt index 6fbc459749870bf5bc6c8d0350ba429468b2a9a2..f6eb685df3c7ac43b83f427fb6d39f68bd64f3f8 100644 --- a/ChangeLog.txt +++ b/ChangeLog.txt @@ -33,6 +33,8 @@ v1.6.0 - 2021-xx-xx Closes #520. - Experimental support for Websockets continuation frames. Closes #500. Closes #89. +- `Properties.json()` now converts Correlation Data bytes() objects to hex. + Closes #555. v1.5.1 - 2020-09-22 diff --git a/src/paho/mqtt/properties.py b/src/paho/mqtt/properties.py index f0c50af8ecf48a47fe77b06abb4219c89eccb908..5cfcdb0ccb2920d290793e964a54e2ee67fc75b5 100644 --- a/src/paho/mqtt/properties.py +++ b/src/paho/mqtt/properties.py @@ -319,7 +319,11 @@ class Properties(object): for name in self.names.keys(): compressedName = name.replace(' ', '') if hasattr(self, compressedName): - data[compressedName] = getattr(self, compressedName) + val = getattr(self, compressedName) + if compressedName == 'CorrelationData' and isinstance(val, bytes): + data[compressedName] = val.hex() + else: + data[compressedName] = val return data def isEmpty(self):