Skip to content

Commit b0a4e53

Browse files
brentrubrentru
authored andcommitted
update examples
1 parent 1be4557 commit b0a4e53

File tree

3 files changed

+8
-10
lines changed

3 files changed

+8
-10
lines changed

examples/minimqtt_adafruitio_wifi.py

Lines changed: 0 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,3 @@
1-
# CircuitPython MiniMQTT Library
2-
# Adafruit IO SSL/TLS Example for WiFi (ESP32SPI)
31
import time
42
import board
53
import busio

examples/minimqtt_pub_sub_nonblocking.py

Lines changed: 0 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,3 @@
1-
# CircuitPython MiniMQTT Library
2-
# Adafruit IO SSL/TLS Example for WiFi (ESP32SPI)
31
import time
42
import board
53
import busio

examples/minimqtt_simpletest.py

Lines changed: 8 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -52,27 +52,29 @@ def connect_wifi():
5252
print("Connected to", str(esp.ssid, 'utf-8'), "\tRSSI:", esp.rssi)
5353
print("IP: ", esp.pretty_ip(esp.ip_address))
5454

55-
# MiniMQTT Callback Handlers
55+
# Define callback methods which are called when events occur
5656
# pylint: disable=unused-argument, redefined-outer-name
5757
def connect(client, userdata, flags, rc):
58-
# This method is called when client.connect() is called.
58+
# This function will be called when the client is connected
59+
# successfully to the broker.
5960
print('Connected to MQTT Broker!')
6061
print('Flags: {0}\n RC: {1}'.format(flags, rc))
6162

6263
def disconnect(client, userdata, rc):
63-
# This method is called when client.disconnect() is called.
64+
# This method is called when the client disconnects
65+
# from the broker.
6466
print('Disconnected from MQTT Broker!')
6567

6668
def subscribe(client, userdata, topic, granted_qos):
67-
# This method is called when client.subscribe() is called.
69+
# This method is called when the client subscribes to a new feed.
6870
print('Subscribed to {0} with QOS level {1}'.format(topic, granted_qos))
6971

7072
def unsubscribe(client, userdata, topic, pid):
71-
# This method is called when client.unsubscribe() is called.
73+
# This method is called when the client unsubscribes from a feed.
7274
print('Unsubscribed from {0} with PID {1}'.format(topic, pid))
7375

7476
def publish(client, userdata, topic, pid):
75-
# This method is called when client.publish() is called.
77+
# This method is called when the client publishes data to a feed.
7678
print('Published to {0} with PID {1}'.format(topic, pid))
7779

7880
# Connect to WiFi

0 commit comments

Comments
 (0)