Skip to content

Commit 60c333d

Browse files
committed
wrap camera blocks in try, allowing bot commands when camera is not available
1 parent eecb0d9 commit 60c333d

File tree

1 file changed

+7
-2
lines changed

1 file changed

+7
-2
lines changed

main.py

Lines changed: 7 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -192,8 +192,13 @@ def handle_bot():
192192
Execute a bot command
193193
"""
194194
bot = CoderBot.get_instance()
195-
cam = Camera.get_instance()
196-
motion = Motion.get_instance()
195+
try:
196+
cam = Camera.get_instance()
197+
motion = Motion.get_instance()
198+
except:
199+
cam = None
200+
motion = None
201+
197202
audio = Audio.get_instance()
198203

199204
cmd = request.args.get('cmd')

0 commit comments

Comments
 (0)