You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Copy file name to clipboardExpand all lines: articles/iot-edge/tutorial-python-module.md
+47-50Lines changed: 47 additions & 50 deletions
Display the source diff
Display the rich diff
Original file line number
Diff line number
Diff line change
@@ -119,7 +119,7 @@ Each template includes sample code, which takes simulated sensor data from the *
119
119
import json
120
120
```
121
121
122
-
3. Add the **TEMPERATURE_THRESHOLD**and**TWIN_CALLBACKS** variables under the global counters. The temperature threshold sets the value that the measured machine temperature must exceed for the data to be sent to the IoT hub.
122
+
3. Add global definitions for**TEMPERATURE_THRESHOLD**, **RECEIVED_MESSAGES**and**TWIN_CALLBACKS** variables. The temperature threshold sets the value that the measured machine temperature must exceed for the data to be sent to the IoT hub.
123
123
124
124
```python
125
125
# global counters
@@ -128,63 +128,60 @@ Each template includes sample code, which takes simulated sensor data from the *
128
128
RECEIVED_MESSAGES = 0
129
129
```
130
130
131
-
4. Replace the **input1_listener** function with the following code:
131
+
4. Replace the **create_client** function with the following code:
132
132
133
133
```python
134
-
# Define behavior for receiving an input message on input1
135
-
# Because this is a filter module, we forward this message to the "output1" queue.
7. In the VS Code explorer, open the **deployment.template.json**filein your IoT Edge solution workspace.
182
+
8. In the VS Code explorer, open the **deployment.template.json**filein your IoT Edge solution workspace.
186
183
187
-
8. Add the **PythonModule** module twin to the deployment manifest. Insert the following JSON content at the bottom of the **moduleContent** section, after the **$edgeHub** module twin:
184
+
9. Add the **PythonModule** module twin to the deployment manifest. Insert the following JSON content at the bottom of the **moduleContent** section, after the **$edgeHub** module twin:
188
185
189
186
```json
190
187
"PythonModule": {
@@ -196,7 +193,7 @@ Each template includes sample code, which takes simulated sensor data from the *
196
193
197
194

0 commit comments