|
|
@@ -335,6 +335,7 @@ def closeService(sleepsecs=0): |
|
|
|
sleep(0.1) |
|
|
|
stopMusic() |
|
|
|
inUseBefore = False # Pfusch pfusch! |
|
|
|
hadUserInteraction = False # reset variable |
|
|
|
setMode('off') |
|
|
|
sleep(sleepsecs) |
|
|
|
|
|
|
@@ -419,6 +420,7 @@ 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) |
|
|
|
hadUserInteraction = False # |
|
|
|
|
|
|
|
setSun('off') |
|
|
|
|
|
|
@@ -447,7 +449,8 @@ while True: |
|
|
|
lastUsed = time.time() |
|
|
|
inUse = True |
|
|
|
else: |
|
|
|
if(time.time() > lastUsed + timeout): |
|
|
|
# Auto timeout |
|
|
|
if(time.time() > lastUsed + timeout and not hadUserInteraction): |
|
|
|
inUse = False |
|
|
|
|
|
|
|
|
|
|
@@ -457,6 +460,7 @@ while True: |
|
|
|
|
|
|
|
if remotesignal: |
|
|
|
lastUsed = time.time() # user is active! |
|
|
|
hadUserInteraction = True |
|
|
|
inUse = True |
|
|
|
for code in remotesignal: |
|
|
|
print('received code:', code) |
|
|
|