@@ -13,8 +13,7 @@ Introduction
13
13
:target: https://travis-ci.com/adafruit/Adafruit_CircuitPython_AzureIoT
14
14
:alt: Build Status
15
15
16
- Access to Microsoft Azure IoT from CircuitPython
17
-
16
+ Access to Microsoft Azure IoT from a CircuitPython device.
18
17
19
18
Dependencies
20
19
=============
@@ -26,38 +25,56 @@ Please ensure all dependencies are available on the CircuitPython filesystem.
26
25
This is easily achieved by downloading
27
26
`the Adafruit library and driver bundle <https://github.com/adafruit/Adafruit_CircuitPython_Bundle >`_.
28
27
29
- Installing from PyPI
30
- --------------------
31
- .. note :: This library is not available on PyPI yet. Install documentation is included
32
- as a standard element. Stay tuned for PyPI availability!
33
- .. todo :: Remove the above note if PyPI version is/will be available at time of release.
34
- If the library is not planned for PyPI, remove the entire 'Installing from PyPI' section.
35
- On supported GNU/Linux systems like the Raspberry Pi, you can install the driver locally `from
36
- PyPI <https://pypi.org/project/adafruit-circuitpython-azureiot/> `_. To install for current user:
28
+ Usage Example
29
+ =============
37
30
38
- .. code-block :: shell
31
+ Create an instance of an Azure IoT Hub:
39
32
40
- pip3 install adafruit-circuitpython-azureiot
33
+ .. code-block :: python
41
34
42
- To install system-wide (this may be required in some cases):
35
+ my_hub = IOT_HUB(wifi, ' Azure_IOT_Hub_Name ' , ' Azure_IOT_Hub_SAS_Token ' )
43
36
44
- .. code-block :: shell
37
+ Send a device-to-cloud message:
45
38
46
- sudo pip3 install adafruit-circuitpython-azureiot
39
+ .. code-block :: python
47
40
48
- To install in a virtual environment in your current project:
41
+ my_hub.send_device_message( ' deviceID ' , ' Hi Azure IoT! ' )
49
42
50
- .. code-block :: shell
43
+ Enumerate all devices on an Azure IOT Hub:
51
44
52
- mkdir project-name && cd project-name
53
- python3 -m venv .env
54
- source .env/bin/activate
55
- pip3 install adafruit-circuitpython-azureiot
45
+ .. code-block :: python
56
46
57
- Usage Example
58
- =============
47
+ hub_devices = my_hub.get_devices()
48
+
49
+ Get a specified device on an Azure IoT Hub:
50
+
51
+ .. code-block :: python
52
+
53
+ device_info = my_hub.get_device(' deviceID' )
54
+
55
+ Create a new device on an Azure IoT Hub:
56
+
57
+ .. code-block :: python
58
+
59
+ my_hub.create_device(' deviceID' )
60
+
61
+ Delete a device from an Azure IoT Hub:
62
+
63
+ .. code-block :: python
64
+
65
+ my_hub.delete_device(' deviceID' )
66
+
67
+ Get a device twin:
68
+
69
+ .. code-block :: python
70
+
71
+ twin_info = my_hub.get_device_twin(' deviceID' )
72
+
73
+ Update a device twin's properties:
74
+
75
+ .. code-block :: python
59
76
60
- .. todo :: Add a quick, simple example. It and other examples should live in the examples folder and be included in docs/examples.rst.
77
+ my_hub.update_device_twin( ' Blinka ' , device_properties)
61
78
62
79
Contributing
63
80
============
0 commit comments