     public let absolute: Double?
     public let temp: RateType
     public let duration: TimeInterval
+    public let automatic: Bool
     
-    public init(timestamp: Date, enteredBy: String, temp: RateType, rate: Double, absolute: Double?, duration: TimeInterval, amount: Double? = nil, id: String? = nil, syncIdentifier: String? = nil, insulinType: String?) {
+    public init(timestamp: Date, enteredBy: String, temp: RateType, rate: Double, absolute: Double?, duration: TimeInterval, amount: Double? = nil, automatic: Bool = true, id: String? = nil, syncIdentifier: String? = nil, insulinType: String?) {
         self.rate = rate
         self.absolute = absolute
         self.temp = temp
         self.duration = duration
         self.amount = amount
+        self.automatic = automatic
         
         // Commenting out usage of surrogate ID until supported by Nightscout
         super.init(timestamp: timestamp, enteredBy: enteredBy, id: id, eventType: .tempBasal, syncIdentifier: syncIdentifier, insulinType: insulinType)

        self.duration = TimeInterval(minutes: durationMinutes)
        self.amount = entry["amount"] as? Double
        self.absolute = entry["absolute"] as? Double

        super.init(entry)
    }

        rval["absolute"] = absolute
        rval["duration"] = duration.minutes
        rval["amount"] = amount
        rval["automatic"] = automatic
        return rval
    }
}
