This course is available as part of the raywenderlich.com Professional subscription. To learn more click here
Pro

Smart Lighting with HomeKit in watchOS

Jan 19 2021 · Video Course (17 mins) · Advanced

Learn to use HomeKit in watchOS to control light bulbs in your home. HomeKit is versatile, so most of what you learn here will apply to any type of smart device.

5/5 3 Ratings

Version

  • Swift 5, iOS 14, Xcode 12

Smart Lighting with HomeKit in watchOS

HomeKit

2:56 Free

HomeKit allows your apps to configure, monitor and control a synchronized central repository of smart home accessories with Apple devices.

1

HMHomeManager provides access to all the HMRooms you'll need, encapsulated in HMHomes, by way of its delegate.

2

HMService

3:39

HMAccessory is how HomeKit models a physical device, and HMService is a collection of related things you can do with that device.

3

On watchOS, you can either tap to interact with SwiftUI sliders, or use the Digital Crown. Bulb Buddy uses a slider for hue, saturation, and brightness.

4

Check an HMCharacteristic's metadata format to ensure you're working with the right kind of values. Throttle sending those values using Combine, if necessary.

5

Who is this for?

This course is designed to introduce working with HomeKit in a targeted, practical way.

To get the most out of it, you'll want to be experienced with Swift, SwiftUI, and Combine. Some familiarity with watchOS will be useful, but you should be able to follow along even if you've never developed for that platform.

HomeKit works similarly across iOS and tvOS as well, so you don't even need to be interested in watchOS development for this course to be useful!

Covered concepts

  • HomeKit
  • HMHomeManager
  • HMRoom
  • HMAccessory
  • HMService
  • HMCharacteristic
  • watchOS
  • SwiftUI Slider
  • Combine

Contributors

Comments