     
     // MARK: IB Actions
     @IBAction func serviceLocationsAction(sender: AnyObject) {
-        getServiceLocations()
+        getActuator()
     }
     
     @IBAction func actuatorOneOn(sender: AnyObject) {

    
    // MARK: SmappeeKit calls

    
    func getServiceLocations() {
        smappeeController.sendServiceLocationRequest { r in
            r.flatMap({ valueOrError($0.first, "No service locations found")
            }).flatMap(self.smappeeController.sendServiceLocationInfoRequest) { r in
                switch r {
                case .Success(let box):
                    let info = box.unbox
                    self.actuator = info.actuators.first
                    println("Success")
                case .Failure(let box):
                    let errorMessage = box.unbox
                    println(errorMessage)
                }
                self.updateButtonStates()
            }
        }
    }
    

        let formatter = NSDateFormatter()
        formatter.dateStyle = .ShortStyle
        formatter.timeStyle = .ShortStyle
        getServiceLocationInfo { r in
            r.flatMap(self.getEventsFromInfo) { r in
                if let events = r.value {
                    for event in events {
                        let date = formatter.stringFromDate(event.timestamp)
                        println("Event: \(event.appliance.name) - \(event.activePower) - \(date)")
                    }
                }
            }
        }
    }
    
    func getConsumptionFromInfo(info: ServiceLocationInfo, completion: Result<[Consumption], String> -> Void) {
        self.smappeeController.sendConsumptionRequest(info.serviceLocation, from: NSDate(timeIntervalSinceNow: -3600*24*100), to: NSDate(), aggregation: .Monthly) {
            r in
            completion(r)
        }
    }

