()
Initiate an alarm.
Initiate an alarm.
Initiate an alarm .
def trigger_alarm() -> None:
    """Initiate an alarm."""
    if redis.get("playing"):
        # if a song is currently playing, inform the loop waiting for the song to end
        # about this alarm. It will interrupt the current song and play the alarm
        redis.set("alarm_requested", True)
    else:
        # insert a special queue song to wake up the main loop and make it play the alarm
        queue.enqueue(musiq.get_alarm_metadata(), True)
        queue_changed.set()
def trigger_alarm ( ) -> None : if redis . get ( "playing" ) : # if a song is currently playing, inform the loop waiting for the song to end # about this alarm. It will interrupt the current song and play the alarm redis . set ( "alarm_requested" , True ) else : # insert a special queue song to wake up the main loop and make it play the alarm queue . enqueue ( musiq . get_alarm_metadata ( ) , True ) queue_changed . set ( )