Option to start PiRadio in Pandora mode.

This commit is contained in:
Pecusx
2017-01-13 00:20:49 +01:00
committed by GitHub
parent 285004b4c8
commit beb1d87910
+7
View File
@@ -30,6 +30,7 @@ class Configuration:
# Input source # Input source
RADIO = 0 RADIO = 0
PLAYER = 1 PLAYER = 1
PANDORA = 2
LIST = 0 LIST = 0
STREAM = 1 STREAM = 1
@@ -186,6 +187,8 @@ class Configuration:
elif option == 'startup': elif option == 'startup':
if parameter == 'MEDIA': if parameter == 'MEDIA':
self.source = self.PLAYER self.source = self.PLAYER
elif parameter == 'PANDORA':
self.source = self.PANDORA
elif option == 'station_names': elif option == 'station_names':
if parameter == 'stream': if parameter == 'stream':
@@ -283,6 +286,10 @@ class Configuration:
+ section + ' in ' + ConfigFile + section + ' in ' + ConfigFile
log.message(msg,log.ERROR) log.message(msg,log.ERROR)
if self.source == self.PANDORA:
if not self.pandora_available:
self.source = self.RADIO
range = self.volume_max - self.volume_min range = self.volume_max - self.volume_min
if range < 22: if range < 22:
self.volume_min = 0 self.volume_min = 0