File tree Expand file tree Collapse file tree 2 files changed +22
-0
lines changed Expand file tree Collapse file tree 2 files changed +22
-0
lines changed Original file line number Diff line number Diff line change @@ -204,3 +204,16 @@ def resetDefaultPrograms():
204
204
with open ("data/defaults/programs/" + filename ) as p :
205
205
q = p .read ()
206
206
programs .insert (json .loads (q ))
207
+
208
+ ## Reset
209
+ def reset ():
210
+ pi = pigpio .pi ('localhost' )
211
+ pi .write (BUTTON_PIN , 0 )
212
+ pi .write (BUTTON_PIN , 1 )
213
+ with open ('/home/pi/log/reset_trigger_service.log' , 'r' ) as log_file :
214
+ data = [x for x in log_file .read ().split ('\n ' ) if x ]
215
+
216
+ return {
217
+ "log" : data ,
218
+ "status" : "ok"
219
+ }
Original file line number Diff line number Diff line change @@ -179,6 +179,15 @@ paths:
179
179
responses :
180
180
200 :
181
181
description : " Bot status"
182
+ /reset :
183
+ get :
184
+ operationId : " api.reset"
185
+ summary : " Reset coderbot by restoring boot partition"
186
+ tags :
187
+ - Coderbot reset
188
+ responses :
189
+ 200 :
190
+ description : " reset log file"
182
191
/stop :
183
192
post :
184
193
operationId : " api.stop"
You can’t perform that action at this time.
0 commit comments