diff --git a/micropython/senml/examples/base.py b/micropython/senml/examples/base.py index c6818886..426cbbd0 100644 --- a/micropython/senml/examples/base.py +++ b/micropython/senml/examples/base.py @@ -25,7 +25,7 @@ THE SOFTWARE. from senml import * -import utime as time +import time pack = SenmlPack("device_name") diff --git a/micropython/senml/examples/basic.py b/micropython/senml/examples/basic.py index 470364f1..18a3a9a0 100644 --- a/micropython/senml/examples/basic.py +++ b/micropython/senml/examples/basic.py @@ -25,7 +25,7 @@ THE SOFTWARE. from senml import * -import utime as time +import time pack = SenmlPack("device") diff --git a/micropython/senml/examples/basic2.py b/micropython/senml/examples/basic2.py index 7c4dee26..c2ea153b 100644 --- a/micropython/senml/examples/basic2.py +++ b/micropython/senml/examples/basic2.py @@ -25,7 +25,7 @@ THE SOFTWARE. from senml import * -import utime as time +import time pack = SenmlPack("device_name") diff --git a/micropython/senml/examples/basic_cbor.py b/micropython/senml/examples/basic_cbor.py index de696b1a..f5e92af3 100644 --- a/micropython/senml/examples/basic_cbor.py +++ b/micropython/senml/examples/basic_cbor.py @@ -25,7 +25,7 @@ THE SOFTWARE. from senml import * -import utime as time +import time from cbor2 import decoder pack = SenmlPack("device_name") diff --git a/micropython/senml/examples/custom_record.py b/micropython/senml/examples/custom_record.py index 07e4e177..e754c897 100644 --- a/micropython/senml/examples/custom_record.py +++ b/micropython/senml/examples/custom_record.py @@ -26,7 +26,7 @@ THE SOFTWARE. from senml import * -import utime as time +import time class Coordinates(SenmlRecord): diff --git a/micropython/senml/examples/gateway.py b/micropython/senml/examples/gateway.py index c3bef12d..d28e4cff 100644 --- a/micropython/senml/examples/gateway.py +++ b/micropython/senml/examples/gateway.py @@ -25,7 +25,7 @@ THE SOFTWARE. from senml import * -import utime as time +import time gateway_pack = SenmlPack("gateway") diff --git a/micropython/senml/examples/supported_data_types.py b/micropython/senml/examples/supported_data_types.py index 59799cb9..3149f49d 100644 --- a/micropython/senml/examples/supported_data_types.py +++ b/micropython/senml/examples/supported_data_types.py @@ -25,7 +25,7 @@ THE SOFTWARE. from senml import * -import utime as time +import time pack = SenmlPack("device_name") diff --git a/micropython/senml/senml/senml_pack.py b/micropython/senml/senml/senml_pack.py index 03ca612a..d528911f 100644 --- a/micropython/senml/senml/senml_pack.py +++ b/micropython/senml/senml/senml_pack.py @@ -26,7 +26,7 @@ THE SOFTWARE. from senml.senml_record import SenmlRecord from senml.senml_base import SenmlBase -import ujson +import json from cbor2 import encoder from cbor2 import decoder @@ -166,7 +166,7 @@ class SenmlPack(SenmlBase): :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): @@ -242,7 +242,7 @@ class SenmlPack(SenmlBase): """ 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): """ diff --git a/micropython/senml/senml/senml_record.py b/micropython/senml/senml/senml_record.py index be280d3a..5c99a447 100644 --- a/micropython/senml/senml/senml_record.py +++ b/micropython/senml/senml/senml_record.py @@ -24,7 +24,7 @@ THE SOFTWARE. """ -import ubinascii +import binascii from senml.senml_base import SenmlBase @@ -229,7 +229,7 @@ class SenmlRecord(SenmlBase): 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