@@ -40,6 +40,11 @@ class ESPSPI_WiFiManager:
40
40
A class to help manage the Wifi connection
41
41
"""
42
42
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
+ """
43
48
# Read the settings
44
49
self ._esp = esp
45
50
self .debug = False
@@ -78,6 +83,14 @@ def connect(self):
78
83
def get (self , url , ** kw ):
79
84
"""
80
85
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
81
94
"""
82
95
if not self ._esp .is_connected :
83
96
self .connect ()
@@ -89,6 +102,14 @@ def get(self, url, **kw):
89
102
def post (self , url , ** kw ):
90
103
"""
91
104
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
92
113
"""
93
114
if not self ._esp .is_connected :
94
115
self .connect ()
@@ -100,6 +121,11 @@ def post(self, url, **kw):
100
121
def ping (self , host , ttl = 250 ):
101
122
"""
102
123
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
103
129
"""
104
130
if not self ._esp .is_connected :
105
131
self .connect ()
@@ -111,6 +137,9 @@ def ping(self, host, ttl=250):
111
137
def neo_status (self , value ):
112
138
"""
113
139
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
114
143
"""
115
144
if self .neopix :
116
145
self .neopix .fill (value )
0 commit comments