Detect when the system isn't connected

This commit is contained in:
2021-03-10 17:47:04 -07:00
parent ec8128d96a
commit ecb8c1f815
2 changed files with 13 additions and 6 deletions
+12 -5
View File
@@ -99,11 +99,18 @@ def session_post(cid):
# go through the photo taking process
status = 'Warming up'
# warmup
power.lights_on()
time.sleep(4)
power.lights_off()
time.sleep(0.5)
try:
# warmup
power.lights_on()
time.sleep(4)
power.lights_off()
time.sleep(0.5)
except BaseException as e:
print('Problem with lights: {} - {}'.format(e.__class__.__name__, str(e)))
print()
print('Are you sure the system is connected?')
print()
abort(500)
status = 'Capturing'