From 7abed967993266be42b6524d22e44e093938f3ef Mon Sep 17 00:00:00 2001 From: Andreas Demmelbauer Date: Tue, 16 Apr 2019 17:33:15 +0200 Subject: [PATCH] change timpout --- discobert.py | 12 +++++++----- 1 file changed, 7 insertions(+), 5 deletions(-) diff --git a/discobert.py b/discobert.py index 2ffb2b9..bd3e5fd 100644 --- a/discobert.py +++ b/discobert.py @@ -31,10 +31,10 @@ class Simple(resource.Resource): # GPIO -pin_kugel = 2 -pin_sun = 4 -pin_pir = 0 -pin_door = 11 +pin_kugel = 2 # Input: dico ball + DMX on/off +pin_sun = 4 # Input: light bulb on/off +pin_pir = 0 # Output: PIR sensor +pin_door = 11 # Output: door open/closed sensor # for system stuff @@ -336,6 +336,7 @@ def closeService(sleepsecs=0): setMode('off') sleep(sleepsecs) +# function when user arrives def initService(): startMusic('0', True) # start intro music setDiscoMode(True) @@ -413,7 +414,7 @@ lastUsed = time.time() # helper for timeout inUse = False # is toilet in use? inUseBefore = False # helper to check statechanges mode = "off" # can be: disco, work, off -timeout = 2 * 60 - 10 # timeout since last user interaction +timeout = 5 * 60 - 5 # timeout since last user interaction defaultvolume = 90 # Volume when user enters the toilet volume = 90 # Global for actual volume uservolume = 90 # Global for user volume (ignores mute state) @@ -433,6 +434,7 @@ while True: # 0 => door closed # 1 => door open if doorstate == 1: + # don't do a doorShutdown when user comes in if (time.time() > (starttime + 15) and inUse == True): doorShutdown()