Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 1 addition & 1 deletion micropython/senml/examples/base.py
Original file line number Diff line number Diff line change
Expand Up @@ -25,7 +25,7 @@


from senml import *
import utime as time
import time


pack = SenmlPack("device_name")
Expand Down
2 changes: 1 addition & 1 deletion micropython/senml/examples/basic.py
Original file line number Diff line number Diff line change
Expand Up @@ -25,7 +25,7 @@


from senml import *
import utime as time
import time


pack = SenmlPack("device")
Expand Down
2 changes: 1 addition & 1 deletion micropython/senml/examples/basic2.py
Original file line number Diff line number Diff line change
Expand Up @@ -25,7 +25,7 @@


from senml import *
import utime as time
import time


pack = SenmlPack("device_name")
Expand Down
2 changes: 1 addition & 1 deletion micropython/senml/examples/basic_cbor.py
Original file line number Diff line number Diff line change
Expand Up @@ -25,7 +25,7 @@


from senml import *
import utime as time
import time
from cbor2 import decoder

pack = SenmlPack("device_name")
Expand Down
2 changes: 1 addition & 1 deletion micropython/senml/examples/custom_record.py
Original file line number Diff line number Diff line change
Expand Up @@ -26,7 +26,7 @@

from senml import *

import utime as time
import time


class Coordinates(SenmlRecord):
Expand Down
2 changes: 1 addition & 1 deletion micropython/senml/examples/gateway.py
Original file line number Diff line number Diff line change
Expand Up @@ -25,7 +25,7 @@


from senml import *
import utime as time
import time

gateway_pack = SenmlPack("gateway")

Expand Down
2 changes: 1 addition & 1 deletion micropython/senml/examples/supported_data_types.py
Original file line number Diff line number Diff line change
Expand Up @@ -25,7 +25,7 @@


from senml import *
import utime as time
import time

pack = SenmlPack("device_name")

Expand Down
6 changes: 3 additions & 3 deletions micropython/senml/senml/senml_pack.py
Original file line number Diff line number Diff line change
Expand Up @@ -26,7 +26,7 @@

from senml.senml_record import SenmlRecord
from senml.senml_base import SenmlBase
import ujson
import json
from cbor2 import encoder
from cbor2 import decoder

Expand Down Expand Up @@ -166,7 +166,7 @@ def from_json(self, data):
:param data: a string containing json data.
:return: None, will r
"""
records = ujson.loads(data) # load the raw senml data
records = json.loads(data) # load the raw senml data
self._process_incomming_data(records, SenmlPack.json_mappings)

def _process_incomming_data(self, records, naming_map):
Expand Down Expand Up @@ -242,7 +242,7 @@ def to_json(self):
"""
converted = []
self._build_rec_dict(SenmlPack.json_mappings, converted)
return ujson.dumps(converted)
return json.dumps(converted)

def _build_rec_dict(self, naming_map, appendTo):
"""
Expand Down
4 changes: 2 additions & 2 deletions micropython/senml/senml/senml_record.py
Original file line number Diff line number Diff line change
Expand Up @@ -24,7 +24,7 @@
"""


import ubinascii
import binascii
from senml.senml_base import SenmlBase


Expand Down Expand Up @@ -229,7 +229,7 @@ def _from_raw(self, raw, naming_map):
elif naming_map["vb"] in raw:
val = raw[naming_map["vb"]]
elif naming_map["vd"] in raw:
val = ubinascii.a2b_base64(raw[naming_map["vb"]])
val = binascii.a2b_base64(raw[naming_map["vb"]])
else:
val = None
self.value = val
Expand Down
6 changes: 3 additions & 3 deletions python-ecosys/cbor2/cbor2/decoder.py
Original file line number Diff line number Diff line change
Expand Up @@ -24,8 +24,8 @@
"""


import uio
import ustruct as struct
import io
import struct


class CBORDecodeError(Exception):
Expand Down Expand Up @@ -248,7 +248,7 @@ def loads(payload, **kwargs):
:param kwargs: keyword arguments passed to :class:`~.CBORDecoder`
:return: the deserialized object
"""
fp = uio.BytesIO(payload)
fp = io.BytesIO(payload)
return CBORDecoder(fp, **kwargs).decode()


Expand Down
6 changes: 3 additions & 3 deletions python-ecosys/cbor2/cbor2/encoder.py
Original file line number Diff line number Diff line change
Expand Up @@ -24,9 +24,9 @@
"""


import uio
import io
import math
import ustruct as struct
import struct


class CBOREncodeError(Exception):
Expand Down Expand Up @@ -169,7 +169,7 @@ def dumps(obj, **kwargs):
:return: the serialized output
:rtype: bytes
"""
fp = uio.BytesIO()
fp = io.BytesIO()
dump(obj, fp, **kwargs)
return fp.getvalue()

Expand Down