Skip to content

Latest commit

 

History

History
48 lines (31 loc) · 1.25 KB

README.md

File metadata and controls

48 lines (31 loc) · 1.25 KB

HomeController

A controller for your home controlled by HomeKit based on objects which makes discovering and interacting with accessories much more feasible.

Carthage

HomeController is available through Carthage. To install it, simply add the following line to your Cartfile:

github "Thumbworks/HomeController"

Setup

As HomeController uses HomeKit, you must:

  1. include an NSHomeKitUsageDescription string in your Info.plist
  2. enable HomeKit capabilities on your Xcode project

Basics

  1. "import HomeController"
  2. Retain an instance of HomeController object.
  3. call setupHomeKit() on this object
  4. Access your home through this object's Home which contains arrays of the following types: DoorLock, Light, Toggle, Thermostat

Documentation

Soulful documentation was created by Jazzy and can be found here

Example usage

let someSwitch = homeController.toggles.first
someSwitch?.updateToggle(.on) { (success) in
    if !success {
        print("something went wrong, update UI accordingly")
    } else 
        print("Looks like it worked, also update UI accordingly")
    }
}

There is a Demo App

Just build and run.