From f62ba47e5719a9e5e4cd8e1802d00d225656b822 Mon Sep 17 00:00:00 2001 From: Pecusx Date: Sun, 5 Mar 2017 13:15:52 +0100 Subject: [PATCH] Sleep Timer button added After this update, you need to change the remote control to another. And after the restart, change the remote control back to the right one. --- radio_class.py | 8 ++++++++ remote_control.py | 1 + version | 2 +- 3 files changed, 10 insertions(+), 1 deletion(-) diff --git a/radio_class.py b/radio_class.py index e7b2625..627cade 100755 --- a/radio_class.py +++ b/radio_class.py @@ -363,6 +363,14 @@ class Radio: self.setDisplayMode(display_mode) # (Pecus) self.setInterrupt() # (Pecus) + elif key == 'KEY_TIME': # timer on/off (Pecus) + if self.display_mode != self.MODE_SLEEP: # no in sleep mode! (Pecus) + if self.getTimer(): + self.timerOff() + else: + self.timerOn() + self.setInterrupt() # (Pecus) + # Handle left,right, up and down keys else: diff --git a/remote_control.py b/remote_control.py index c84e525..dc80700 100755 --- a/remote_control.py +++ b/remote_control.py @@ -161,6 +161,7 @@ def listener(): listener.register('KEY_RADIO',handleIRevent) # (Pecus) listener.register('KEY_MEDIA',handleIRevent) # (Pecus) listener.register('KEY_PANDORA',handleIRevent) # (Pecus) + listener.register('KEY_TIME',handleIRevent) # (Pecus) log.message("Activating IR Remote Control listener", log.DEBUG) listener.activate() diff --git a/version b/version index c390f3c..393b602 100644 --- a/version +++ b/version @@ -1 +1 @@ -5.4g +5.4h