@@ -52,27 +52,29 @@ def connect_wifi():
5252 print ("Connected to" , str (esp .ssid , 'utf-8' ), "\t RSSI:" , 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
5757def 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
6263def 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
6668def 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
7072def 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
7476def 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