kopia lustrzana https://github.com/micropython/micropython-lib
senml: Fix data record encoding to use binascii instead of base64.
rodzic
295a9e300a
commit
c8603192d1
|
@ -190,7 +190,9 @@ class SenmlRecord(SenmlBase):
|
||||||
if (
|
if (
|
||||||
naming_map["vd"] == "vd"
|
naming_map["vd"] == "vd"
|
||||||
): # neeed to make a distinction between json (needs base64) and cbor (needs binary)
|
): # neeed to make a distinction between json (needs base64) and cbor (needs binary)
|
||||||
result[naming_map["vd"]] = base64.b64encode(self._value)
|
result[naming_map["vd"]] = binascii.b2a_base64(self._value, newline=False).decode(
|
||||||
|
"utf8"
|
||||||
|
)
|
||||||
else:
|
else:
|
||||||
result[naming_map["vd"]] = self._value
|
result[naming_map["vd"]] = self._value
|
||||||
else:
|
else:
|
||||||
|
|
Ładowanie…
Reference in New Issue