|
@@ -335,6 +335,7 @@ def closeService(sleepsecs=0): |
|
|
sleep(0.1) |
|
|
sleep(0.1) |
|
|
stopMusic() |
|
|
stopMusic() |
|
|
inUseBefore = False # Pfusch pfusch! |
|
|
inUseBefore = False # Pfusch pfusch! |
|
|
|
|
|
hadUserInteraction = False # reset variable |
|
|
setMode('off') |
|
|
setMode('off') |
|
|
sleep(sleepsecs) |
|
|
sleep(sleepsecs) |
|
|
|
|
|
|
|
@@ -419,6 +420,7 @@ timeout = 5 * 60 - 5 # timeout since last user interaction |
|
|
defaultvolume = 90 # Volume when user enters the toilet |
|
|
defaultvolume = 90 # Volume when user enters the toilet |
|
|
volume = 90 # Global for actual volume |
|
|
volume = 90 # Global for actual volume |
|
|
uservolume = 90 # Global for user volume (ignores mute state) |
|
|
uservolume = 90 # Global for user volume (ignores mute state) |
|
|
|
|
|
hadUserInteraction = False # |
|
|
|
|
|
|
|
|
setSun('off') |
|
|
setSun('off') |
|
|
|
|
|
|
|
@@ -447,7 +449,8 @@ while True: |
|
|
lastUsed = time.time() |
|
|
lastUsed = time.time() |
|
|
inUse = True |
|
|
inUse = True |
|
|
else: |
|
|
else: |
|
|
if(time.time() > lastUsed + timeout): |
|
|
|
|
|
|
|
|
# Auto timeout |
|
|
|
|
|
if(time.time() > lastUsed + timeout and not hadUserInteraction): |
|
|
inUse = False |
|
|
inUse = False |
|
|
|
|
|
|
|
|
|
|
|
|
|
@@ -457,6 +460,7 @@ while True: |
|
|
|
|
|
|
|
|
if remotesignal: |
|
|
if remotesignal: |
|
|
lastUsed = time.time() # user is active! |
|
|
lastUsed = time.time() # user is active! |
|
|
|
|
|
hadUserInteraction = True |
|
|
inUse = True |
|
|
inUse = True |
|
|
for code in remotesignal: |
|
|
for code in remotesignal: |
|
|
print('received code:', code) |
|
|
print('received code:', code) |
|
|