A controller for your home controlled by HomeKit based on objects which makes discovering and interacting with accessories much more feasible.
HomeController is available through Carthage. To install it, simply add the following line to your Cartfile:
github "Thumbworks/HomeController"
As HomeController uses HomeKit, you must:
- include an
NSHomeKitUsageDescriptionstring in your Info.plist - enable HomeKit capabilities on your Xcode project
- "import HomeController"
- Retain an instance of
HomeControllerobject. - call
setupHomeKit()on this object - Access your home through this object's
Homewhich contains arrays of the following types:DoorLock,Light,Toggle,Thermostat
Soulful documentation was created by Jazzy and can be found here
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")
}
}Just build and run.