@@ -40,6 +40,11 @@ class ESPSPI_WiFiManager:
4040 A class to help manage the Wifi connection
4141 """
4242 def __init__ (self , esp , settings , status_neopixel = None ):
43+ """
44+ :param ESP_SPIcontrol esp: The ESP object we are using
45+ :param dict settings: The WiFi and Adafruit IO Settings (See examples)
46+ :param pin status_neopixel: (optional) The pin for the neopixel - Usually board.NEOPIXEL (default=None)
47+ """
4348 # Read the settings
4449 self ._esp = esp
4550 self .debug = False
@@ -78,6 +83,14 @@ def connect(self):
7883 def get (self , url , ** kw ):
7984 """
8085 Pass the Get request to requests and update Status NeoPixel
86+
87+ :param str url: The URL to retrieve data from
88+ :param dict data: (Optional) Form data to submit
89+ :param dict json: (Optional) JSON data to submit. (Data must be None)
90+ :param dict header: (Optional) Header data to include
91+ :param bool stream: (Optional) Whether to stream the Response
92+ :return: The response from the request
93+ :rtype: Response
8194 """
8295 if not self ._esp .is_connected :
8396 self .connect ()
@@ -89,6 +102,14 @@ def get(self, url, **kw):
89102 def post (self , url , ** kw ):
90103 """
91104 Pass the Post request to requests and update Status NeoPixel
105+
106+ :param str url: The URL to post data to
107+ :param dict data: (Optional) Form data to submit
108+ :param dict json: (Optional) JSON data to submit. (Data must be None)
109+ :param dict header: (Optional) Header data to include
110+ :param bool stream: (Optional) Whether to stream the Response
111+ :return: The response from the request
112+ :rtype: Response
92113 """
93114 if not self ._esp .is_connected :
94115 self .connect ()
@@ -100,6 +121,11 @@ def post(self, url, **kw):
100121 def ping (self , host , ttl = 250 ):
101122 """
102123 Pass the Ping request to the ESP32, update Status NeoPixel, return response time
124+
125+ :param str host: The hostname or IP address to ping
126+ :param int ttl: (Optional) The Time To Live in milliseconds for the packet (default=250)
127+ :return: The response time in milliseconds
128+ :rtype: int
103129 """
104130 if not self ._esp .is_connected :
105131 self .connect ()
@@ -111,6 +137,9 @@ def ping(self, host, ttl=250):
111137 def neo_status (self , value ):
112138 """
113139 Change Status NeoPixel if it was defined
140+
141+ :param value: The value to set the Board's Status NeoPixel to
142+ :type value: int or 3-value tuple
114143 """
115144 if self .neopix :
116145 self .neopix .fill (value )
0 commit comments