             when "alarm.delete"
                 @clearTimeouts id
 
+    # find all notifications for a DS's alarm object
+    # and call addAlarmCounter for each one
     addAlarmCounters: (alarm) ->
         @clearTimeouts alarm._id
         now = new tDate()

            @timeouts[alarm._id] ?= []
            @timeouts[alarm._id].push setTimeout (=> @handleNotification alarm) , delta

    handleNotification = (alarm) =>

        if alarm.action in ['DISPLAY', 'BOTH']

    constructor: (@timezone, @Alarm, @notificationhelper) ->
        @fetchAlarms()

    # retrieve alarms from DS and call addAlarmCounters for
    # each one
    fetchAlarms: () =>
        @dailytimer = setTimeout @fetchAlarms, oneDay
        # We load the alarms for the next 24h
        @Alarm.all (err, alarms) =>
            @addAlarmCounters alarm for alarm in alarms

    # cancel all timeouts for a given id
    clearTimeouts: (id) ->
        if @timeouts[id]?
            clearTimeout timeout for timeout in @timeouts[id]
