New options for volume range.

This commit is contained in:
Pecusx
2016-11-26 14:37:02 +01:00
committed by GitHub
parent 295655eadc
commit c0768727c3
4 changed files with 72 additions and 51 deletions
+8 -2
View File
@@ -906,7 +906,7 @@ def display_search(lcd,radio):
def unmuteRadio(lcd,radio):
radio.unmute()
volume = radio.getVolume()
lcd.line4("Volume " + str(volume))
lcd.line4("Volume " + str(VolumeToDisplay(volume)))
radio.setDisplayMode(radio.MODE_TIME)
return
@@ -987,7 +987,7 @@ def displayVolume(lcd,radio):
if radio.muted():
msg = "Sound muted"
else:
msg = "Volume " + str(radio.getVolume())
msg = "Volume " + str(VolumeToDisplay(radio.getVolume()))
if radio.getTimer():
msg = msg + " " + radio.getTimerString()
if radio.alarmActive():
@@ -1054,6 +1054,12 @@ def displayInfo(lcd,ipaddr,mpd_version):
lcd.scroll1("IP "+ ipaddr,interrupt)
return
def VolumeToDisplay(volume):
volume = (volume - config.getVolumeMin()) * 100
tym = (config.getVolumeMax() - config.getVolumeMin())
volume = volume / tym
return volume
# Check Timer fired
def checkTimer(radio):
interrupt = False