@@ -145,6 +145,63 @@ def post(self, url, **kw):
145
145
self .neo_status (0 )
146
146
return return_val
147
147
148
+ def put (self , url , ** kw ):
149
+ """
150
+ Pass the put request to requests and update Status NeoPixel
151
+
152
+ :param str url: The URL to PUT data to
153
+ :param dict data: (Optional) Form data to submit
154
+ :param dict json: (Optional) JSON data to submit. (Data must be None)
155
+ :param dict header: (Optional) Header data to include
156
+ :param bool stream: (Optional) Whether to stream the Response
157
+ :return: The response from the request
158
+ :rtype: Response
159
+ """
160
+ if not self ._esp .is_connected :
161
+ self .connect ()
162
+ self .neo_status ((100 , 100 , 0 ))
163
+ return_val = requests .put (url , ** kw )
164
+ self .neo_status (0 )
165
+ return return_val
166
+
167
+ def patch (self , url , ** kw ):
168
+ """
169
+ Pass the patch request to requests and update Status NeoPixel
170
+
171
+ :param str url: The URL to PUT data to
172
+ :param dict data: (Optional) Form data to submit
173
+ :param dict json: (Optional) JSON data to submit. (Data must be None)
174
+ :param dict header: (Optional) Header data to include
175
+ :param bool stream: (Optional) Whether to stream the Response
176
+ :return: The response from the request
177
+ :rtype: Response
178
+ """
179
+ if not self ._esp .is_connected :
180
+ self .connect ()
181
+ self .neo_status ((100 , 100 , 0 ))
182
+ return_val = requests .patch (url , ** kw )
183
+ self .neo_status (0 )
184
+ return return_val
185
+
186
+ def delete (self , url , ** kw ):
187
+ """
188
+ Pass the delete request to requests and update Status NeoPixel
189
+
190
+ :param str url: The URL to PUT data to
191
+ :param dict data: (Optional) Form data to submit
192
+ :param dict json: (Optional) JSON data to submit. (Data must be None)
193
+ :param dict header: (Optional) Header data to include
194
+ :param bool stream: (Optional) Whether to stream the Response
195
+ :return: The response from the request
196
+ :rtype: Response
197
+ """
198
+ if not self ._esp .is_connected :
199
+ self .connect ()
200
+ self .neo_status ((100 , 100 , 0 ))
201
+ return_val = requests .delete (url , ** kw )
202
+ self .neo_status (0 )
203
+ return return_val
204
+
148
205
def ping (self , host , ttl = 250 ):
149
206
"""
150
207
Pass the Ping request to the ESP32, update Status NeoPixel, return response time
0 commit comments