diff --git a/discobert.py b/discobert.py index 605b3ee..3d539d8 100644 --- a/discobert.py +++ b/discobert.py @@ -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) diff --git a/oe1journal.py b/oe1journal.py new file mode 100644 index 0000000..7df4b1c --- /dev/null +++ b/oe1journal.py @@ -0,0 +1,7 @@ +import requests +from xml.etree import ElementTree as ET + +podcast = 'https://files.orf.at/podcast/oe1/oe1_journale.xml' +podcast_string = requests.get(podcast).text +tree = ET.fromstring(podcast_string) +print(tree.find('.//enclosure').get('url')) diff --git a/remotes/.Sony-RM-V33E.lircd.conf.swp b/remotes/.Sony-RM-V33E.lircd.conf.swp new file mode 100644 index 0000000..1c81835 Binary files /dev/null and b/remotes/.Sony-RM-V33E.lircd.conf.swp differ diff --git a/requirements.txt b/requirements.txt index 793f8bd..d907ff6 100644 --- a/requirements.txt +++ b/requirements.txt @@ -34,3 +34,4 @@ virtualenv==15.1.0 Werkzeug==0.14.1 wiringpi==2.46.0 youtube-dl==2019.3.18 +twisted