         }
     }
 
-    var maxVoltage: Double {
+    public var maxVoltage: Double {
         switch self {
         case .alkaline:
             return 1.58


import Foundation

enum BatteryChemistryType: Int, CustomStringConvertible {
    case alkaline = 0
    case lithium

    var description: String {
        switch self {
        case .alkaline:
            return NSLocalizedString("Alkaline", comment: "Describing the battery chemistry as Alkaline")

        }
    }

    public func chargeRemaining(voltage: Double) -> Double {
        let computed = (voltage - self.minVoltage)/(self.maxVoltage - self.minVoltage)
        return max(min(computed, 1), 0)
    }
