Skip to content

ucloud: Update module imports. #46

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Merged
merged 1 commit into from
Feb 17, 2023
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
1 change: 0 additions & 1 deletion README.md
Original file line number Diff line number Diff line change
Expand Up @@ -96,7 +96,6 @@ openssl x509 -in cert.pem -out cert.der -outform DER

## Useful links

* [ulogging](https://github.com/iabdalkader/micropython-ulogging)
* [senml-micropython](https://github.com/kpn-iot/senml-micropython-library)
* [m2crypto](https://github.com/m2crypto/m2crypto)
* [umqtt.simple](https://github.com/micropython/micropython-lib/tree/master/micropython/umqtt.simple)
Expand Down
3 changes: 1 addition & 2 deletions arduino_iot_cloud/ucloud.py
Original file line number Diff line number Diff line change
Expand Up @@ -5,17 +5,16 @@
# file, You can obtain one at https://mozilla.org/MPL/2.0/.

import time
import logging
from kpn_senml import SenmlPack
from kpn_senml import SenmlRecord
from arduino_iot_cloud.umqtt import MQTTClient

try:
import logging
import asyncio
from asyncio import CancelledError
from asyncio import InvalidStateError
except ImportError:
import ulogging as logging
import uasyncio as asyncio
from uasyncio.core import CancelledError

Expand Down
13 changes: 5 additions & 8 deletions arduino_iot_cloud/umqtt.py
Original file line number Diff line number Diff line change
Expand Up @@ -22,17 +22,14 @@
#
# Based on: https://github.com/micropython/micropython-lib/tree/master/micropython/umqtt.simple

import socket
import struct
import select
import logging

try:
from ussl import wrap_socket
import usocket as socket
import ustruct as struct
import ulogging as logging
import uselect as select
except ImportError:
import socket
import struct
import logging
import select
from arduino_iot_cloud.ussl import wrap_socket


Expand Down
4 changes: 2 additions & 2 deletions examples/micropython.py
Original file line number Diff line number Diff line change
Expand Up @@ -4,8 +4,8 @@
import time
import ussl
import network
import ulogging as logging
from ulogging.ustrftime import strftime
import logging
from time import strftime
from arduino_iot_cloud import AIOTClient
from arduino_iot_cloud import Location
from arduino_iot_cloud import Schedule
Expand Down