Stability improvement in Pandora and proper shutdown in LIRC (#2299)

* Pandora cleanups and enhancements

Added media_content_type
reduced debug messages
made more robust station list
Eliminated auto-pause detection issue

* Added proper de-init of LIRC

* Now won't re-spawn Pandora client if turn_on command is sent twice
This commit is contained in:
Nick Touran
2016-06-14 22:42:54 -07:00
committed by Paulus Schoutsen
parent 7b8b78ec0e
commit 5c601f1d5f
2 changed files with 30 additions and 9 deletions

View File

@@ -65,6 +65,7 @@ class LircInterface(threading.Thread):
def run(self):
"""Main loop of LIRC interface thread."""
import lirc
_LOGGER.debug('LIRC interface thread started')
while not self.stopped.isSet():
try:
code = lirc.nextcode() # list; empty if no buttons pressed
@@ -80,4 +81,5 @@ class LircInterface(threading.Thread):
{BUTTON_NAME: code})
else:
time.sleep(0.2)
_LOGGER.info('LIRC interface thread stopped')
lirc.deinit()
_LOGGER.debug('LIRC interface thread stopped')