From 4c152399962cb2ecd48f6e75d956bb0148bbbc85 Mon Sep 17 00:00:00 2001 From: petrucci4prez Date: Wed, 31 May 2017 00:24:50 -0400 Subject: [PATCH] move usb reset to statemachine where the usb stuff actually is --- main.py | 2 -- stateMachine.py | 4 +++- 2 files changed, 3 insertions(+), 3 deletions(-) diff --git a/main.py b/main.py index 1b80f8c..7774238 100755 --- a/main.py +++ b/main.py @@ -5,7 +5,6 @@ import RPi.GPIO as GPIO from sharedLogging import unmountGluster # this should be first program module from stateMachine import StateMachine -from auxilary import resetUSBDevice logger = logging.getLogger(__name__) @@ -33,7 +32,6 @@ if __name__ == '__main__': GPIO.setwarnings(False) GPIO.setmode(GPIO.BCM) - resetUSBDevice('1-1') stateMachine = StateMachine() diff --git a/stateMachine.py b/stateMachine.py index fb4727e..99bd253 100644 --- a/stateMachine.py +++ b/stateMachine.py @@ -5,7 +5,7 @@ from threading import Lock from functools import partial from collections import namedtuple -from auxilary import CountdownTimer, ConfigFile +from auxilary import CountdownTimer, ConfigFile, resetUSBDevice from sensors import setupDoorSensor, setupMotionSensor from notifier import intruderAlert from listeners import KeypadListener, PipeListener @@ -16,6 +16,8 @@ from stream import initCamera logger = logging.getLogger(__name__) +resetUSBDevice('1-1') + class SIGNALS: ARM = 1 INSTANT_ARM = 2