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:
- include an
NSHomeKitUsageDescriptionstring in your Info.plist - enable HomeKit capabilities on your Xcode project
Basics
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
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.
View on GitHub
Reference