mirror of
https://github.com/pkali/piradio-mini.git
synced 2026-05-20 22:34:22 +02:00
minor changes
This commit is contained in:
@@ -342,9 +342,6 @@ def get_switch_states(lcd,radio,rss):
|
|||||||
|
|
||||||
if switch == menu_switch:
|
if switch == menu_switch:
|
||||||
log.message("MENU switch", log.DEBUG)
|
log.message("MENU switch", log.DEBUG)
|
||||||
if radio.muted():
|
|
||||||
unmuteRadio(lcd,radio)
|
|
||||||
|
|
||||||
# Shutdown if menu button held for > 3 seconds
|
# Shutdown if menu button held for > 3 seconds
|
||||||
MenuSwitch = GPIO.input(menu_switch)
|
MenuSwitch = GPIO.input(menu_switch)
|
||||||
count = 15
|
count = 15
|
||||||
@@ -357,15 +354,19 @@ def get_switch_states(lcd,radio,rss):
|
|||||||
MenuSwitch = False
|
MenuSwitch = False
|
||||||
radio.setDisplayMode(radio.MODE_SHUTDOWN)
|
radio.setDisplayMode(radio.MODE_SHUTDOWN)
|
||||||
|
|
||||||
# Send remote code (simulate IR remote key)
|
if display_mode == radio.MODE_SLEEP:
|
||||||
udpSend('KEY_OK')
|
# Send remote code (simulate IR remote key)
|
||||||
|
udpSend('KEY_WAKEUP')
|
||||||
|
else:
|
||||||
|
if radio.muted():
|
||||||
|
unmuteRadio(lcd,radio)
|
||||||
|
# Send remote code (simulate IR remote key)
|
||||||
|
udpSend('KEY_OK')
|
||||||
|
|
||||||
elif switch == up_switch:
|
elif switch == up_switch:
|
||||||
log.message("UP switch display_mode " + str(display_mode), log.DEBUG)
|
log.message("UP switch display_mode " + str(display_mode), log.DEBUG)
|
||||||
|
|
||||||
if display_mode != radio.MODE_SLEEP:
|
if display_mode != radio.MODE_SLEEP:
|
||||||
if radio.muted():
|
|
||||||
unmuteRadio(lcd,radio)
|
|
||||||
|
|
||||||
if display_mode == radio.MODE_TIME:
|
if display_mode == radio.MODE_TIME:
|
||||||
# Send remote code (simulate IR remote key)
|
# Send remote code (simulate IR remote key)
|
||||||
@@ -382,8 +383,6 @@ def get_switch_states(lcd,radio,rss):
|
|||||||
log.message("DOWN switch display_mode " + str(display_mode), log.DEBUG)
|
log.message("DOWN switch display_mode " + str(display_mode), log.DEBUG)
|
||||||
|
|
||||||
if display_mode != radio.MODE_SLEEP:
|
if display_mode != radio.MODE_SLEEP:
|
||||||
if radio.muted():
|
|
||||||
unmuteRadio(lcd,radio)
|
|
||||||
|
|
||||||
if display_mode == radio.MODE_TIME:
|
if display_mode == radio.MODE_TIME:
|
||||||
# Send remote code (simulate IR remote key)
|
# Send remote code (simulate IR remote key)
|
||||||
@@ -647,12 +646,11 @@ def unmuteRadio(lcd,radio):
|
|||||||
radio.unmute()
|
radio.unmute()
|
||||||
volume = radio.getVolume()
|
volume = radio.getVolume()
|
||||||
lcd.line4("Volume " + str(VolumeToDisplay(volume)))
|
lcd.line4("Volume " + str(VolumeToDisplay(volume)))
|
||||||
radio.setDisplayMode(radio.MODE_TIME)
|
# radio.setDisplayMode(radio.MODE_TIME)
|
||||||
return
|
return
|
||||||
|
|
||||||
# Options menu
|
# Options menu
|
||||||
def display_options(lcd,radio):
|
def display_options(lcd,radio):
|
||||||
|
|
||||||
option = radio.getOption()
|
option = radio.getOption()
|
||||||
|
|
||||||
if option != radio.TIMER and option != radio.ALARM \
|
if option != radio.TIMER and option != radio.ALARM \
|
||||||
|
|||||||
Reference in New Issue
Block a user