mirror of
https://github.com/Pecusx/piradio-mini.git
synced 2026-05-20 22:33:44 +02:00
Proper storing the initial timer time.
This commit is contained in:
+5
-3
@@ -353,7 +353,7 @@ class Radio:
|
|||||||
now = int(time.time()) # (Pecus)
|
now = int(time.time()) # (Pecus)
|
||||||
self.timeTimer = now - self.timerValue * 60 # (Pecus)
|
self.timeTimer = now - self.timerValue * 60 # (Pecus)
|
||||||
self.fireTimer() # (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)
|
self.setInterrupt() # (Pecus)
|
||||||
time.sleep(0.5) # Zapobiega przewinieciu sie calego tytulu pandory na LCD przed wylaczeniem... dlaczego???
|
time.sleep(0.5) # Zapobiega przewinieciu sie calego tytulu pandory na LCD przed wylaczeniem... dlaczego???
|
||||||
self.setInterrupt() # (Pecus)
|
self.setInterrupt() # (Pecus)
|
||||||
@@ -1157,7 +1157,7 @@ class Radio:
|
|||||||
if now > self.timeTimer + self.timerValue * 60:
|
if now > self.timeTimer + self.timerValue * 60:
|
||||||
fireTimer = True
|
fireTimer = True
|
||||||
# Store fired value
|
# Store fired value
|
||||||
self.storeTimer(self.timerValue)
|
# self.storeTimer(self.timerValue)
|
||||||
self.timerOff()
|
self.timerOff()
|
||||||
return fireTimer
|
return fireTimer
|
||||||
|
|
||||||
@@ -1532,7 +1532,6 @@ class Radio:
|
|||||||
# If a reload has been issued return to TIME display
|
# If a reload has been issued return to TIME display
|
||||||
if self.getReload():
|
if self.getReload():
|
||||||
display_mode = self.MODE_TIME
|
display_mode = self.MODE_TIME
|
||||||
|
|
||||||
elif self.search_index+1 != self.current_id: # zmiana kanalu radiowego lub utworu przez menu
|
elif self.search_index+1 != self.current_id: # zmiana kanalu radiowego lub utworu przez menu
|
||||||
self.current_id = self.search_index+1
|
self.current_id = self.search_index+1
|
||||||
self.play(self.current_id)
|
self.play(self.current_id)
|
||||||
@@ -1549,6 +1548,9 @@ class Radio:
|
|||||||
if self.optionChanged():
|
if self.optionChanged():
|
||||||
display_mode = self.MODE_TIME
|
display_mode = self.MODE_TIME
|
||||||
self.optionChangedFalse()
|
self.optionChangedFalse()
|
||||||
|
# If new time of Timer is set - Save it
|
||||||
|
if self.timerValue != self.getStoredTimer():
|
||||||
|
self.storeTimer(self.timerValue)
|
||||||
|
|
||||||
self.setDisplayMode(display_mode)
|
self.setDisplayMode(display_mode)
|
||||||
return
|
return
|
||||||
|
|||||||
Reference in New Issue
Block a user