Sleep timer fades instead of stopping abruptly. Volume staysat original setting instead of saving at 0.
This commit is contained in:
@@ -110,6 +110,19 @@ class SleepTimerMenu:
|
||||
return True
|
||||
return False
|
||||
|
||||
def should_start_fadeout(self):
|
||||
"""
|
||||
Check if we should start fading out (10 seconds before timer expiration)
|
||||
|
||||
Returns:
|
||||
True if we're within 10 seconds of timer expiration
|
||||
"""
|
||||
if not self.timerActive:
|
||||
return False
|
||||
|
||||
remaining = self.timerEndTime - time.time()
|
||||
return 0 < remaining <= 10
|
||||
|
||||
def get_time_remaining(self):
|
||||
"""
|
||||
Get time remaining on sleep timer
|
||||
@@ -135,6 +148,13 @@ class SleepTimerMenu:
|
||||
self.timerEndTime = None
|
||||
self.speechEngine.speak("Sleep timer cancelled")
|
||||
|
||||
def reset_fadeout_state(self):
|
||||
"""
|
||||
Reset fade-out state (called when timer is cancelled or new timer set)
|
||||
Returns the fade state so the caller can restore volume if needed
|
||||
"""
|
||||
return {'isFadingOut': False, 'fadeStartVolume': None, 'fadeStartTime': None}
|
||||
|
||||
def is_timer_active(self):
|
||||
"""Check if sleep timer is active"""
|
||||
return self.timerActive
|
||||
|
||||
Reference in New Issue
Block a user