From 907b931e8573458b02d3a35ee676c06fcbd670fd Mon Sep 17 00:00:00 2001 From: Pecusx Date: Wed, 8 Mar 2017 22:30:35 +0100 Subject: [PATCH] Proper storing the initial timer time. --- radio_class.py | 8 +++++--- 1 file changed, 5 insertions(+), 3 deletions(-) diff --git a/radio_class.py b/radio_class.py index 8c96d0c..25a2422 100755 --- a/radio_class.py +++ b/radio_class.py @@ -353,7 +353,7 @@ class Radio: now = int(time.time()) # (Pecus) self.timeTimer = now - self.timerValue * 60 # (Pecus) self.fireTimer() # (Pecus) - time.sleep(0.5) + time.sleep(0.5) # Zapobiega przewinieciu sie calego tytulu pandory na LCD przed wylaczeniem... dlaczego??? self.setInterrupt() # (Pecus) time.sleep(0.5) # Zapobiega przewinieciu sie calego tytulu pandory na LCD przed wylaczeniem... dlaczego??? self.setInterrupt() # (Pecus) @@ -1157,7 +1157,7 @@ class Radio: if now > self.timeTimer + self.timerValue * 60: fireTimer = True # Store fired value - self.storeTimer(self.timerValue) + # self.storeTimer(self.timerValue) self.timerOff() return fireTimer @@ -1532,7 +1532,6 @@ class Radio: # If a reload has been issued return to TIME display if self.getReload(): display_mode = self.MODE_TIME - elif self.search_index+1 != self.current_id: # zmiana kanalu radiowego lub utworu przez menu self.current_id = self.search_index+1 self.play(self.current_id) @@ -1549,6 +1548,9 @@ class Radio: if self.optionChanged(): display_mode = self.MODE_TIME self.optionChangedFalse() + # If new time of Timer is set - Save it + if self.timerValue != self.getStoredTimer(): + self.storeTimer(self.timerValue) self.setDisplayMode(display_mode) return