 class DeviceDataManager: CarbStoreDelegate, TransmitterDelegate {
     /// Notification posted by the instance when new glucose data was processed
     static let GlucoseUpdatedNotification = "com.loudnate.Naterade.notification.GlucoseUpdated"
-    
+
     /// Notification posted by the instance when new pump data was processed
     static let PumpStatusUpdatedNotification = "com.loudnate.Naterade.notification.PumpStatusUpdated"
-    
+
     // MARK: - Utilities
-    
+
     lazy var logger = DiagnosticLogger()
-    
+
     /// Manages all the RileyLinks
     let rileyLinkManager: RileyLinkDeviceManager
-    
+
     /// The share server client
     private let shareClient: ShareClient?
-    
+
     /// Nightscout Uploader
     var nightscoutUploader: NightscoutUploader?
-    
+
     // Timestamp of last event we've retrieved from pump
     var observingPumpEventsSince: NSDate = NSDate().dateByAddingTimeInterval(60*60*24*(-1))
-    
-    
+
+
     /// The G5 transmitter object
     var transmitter: Transmitter? {
         switch transmitterState {

                self.logger?.addError(error, fromSource: "DoseStore")
                return
            }
            
            self.latestReservoirValue = newValue
            
            if self.preferredInsulinDataSource == .PumpHistory {
                self.fetchPumpHistory()
            } else {
                NSNotificationCenter.defaultCenter().postNotificationName(self.dynamicType.PumpStatusUpdatedNotification, object: self)
            }
            
            // Send notifications for low reservoir if necessary
            if let newVolume = newValue?.unitVolume, previousVolume = previousValue?.unitVolume {
                guard newVolume > 0 else {
                    NotificationManager.sendPumpReservoirEmptyNotification()
                    return
                }
                
                let warningThresholds: [Double] = [10, 20, 30]
                
                for threshold in warningThresholds {
                    if newVolume <= threshold && previousVolume > threshold {
                        NotificationManager.sendPumpReservoirLowNotificationForAmount(newVolume, andTimeRemaining: timeLeft)

        guard let device = rileyLinkManager.firstConnectedDevice else {
            return
        }

        device.assertIdleListening()

        // How long should we wait before we poll for new reservoir data?
        let reservoirTolerance = rileyLinkManager.idleListeningEnabled ? NSTimeInterval(minutes: 11) : NSTimeInterval(minutes: 4)

        // If we don't yet have reservoir data, or it's old, poll for it.
        if latestReservoirValue == nil || latestReservoirValue!.startDate.timeIntervalSinceNow <= -reservoirTolerance {
            device.ops?.readRemainingInsulin { (result) in
