-
Undocumented
Declaration
Swift
internal(set) public var name: String { get set }
-
Undocumented
Declaration
Swift
public let isBridge: Bool
-
Undocumented
Declaration
Swift
public var setupCode: String { get }
-
Undocumented
Declaration
Swift
public weak var delegate: DeviceDelegate?
-
A bridge is a special type of HAP accessory server that bridges HomeKit Accessory Protocol and different RF/transport protocols, such as ZigBee or Z-Wave. A bridge must expose all the user-addressable functionality supported by its connected devices as HAP accessory objects to the HAP controller(s). A bridge must ensure that the instance ID assigned to the HAP accessory objects exposed on behalf of its connected devices do not change for the lifetime of the server/client pairing.
For example, a bridge that bridges three lights would expose four HAP accessory objects: one HAP accessory object that represents the bridge itself that may include a “firmware update” service, and three additional HAP accessory objects that each contain a “lightbulb” service.
A bridge must not expose more than 100 HAP accessory objects.
Any accessories, regardless of transport, that enable physical access to the home, such as door locks, must not be bridged. Accessories that support IP transports, such as Wi-Fi, must not be bridged. Accessories that support Bluetooth LE that can be controlled, such as a light bulb, must not be bridged. Accessories that support Bluetooth LE that only provide data, such as a temperature sensor, and accessories that support other transports, such as a ZigBee light bulb or a proprietary RF sensor, may be bridged.
Declaration
Parameters
bridgeInfo
information about the bridge
setupCode
the code to pair this device, must be in the format XXX-XX-XXX
storage
persistence interface for storing pairings, secrets
accessories
accessories to be bridged
-
An HAP accessory object represents a physical accessory on an HAP accessory server. For example, a thermostat would expose a single HAP accessory object that represents the user-addressable functionality of the thermostat.
- Optional Parameters:
- setupCode: the code to pair this device, must be in the format XXX-XX-XXX if not provided, a code is generated automatically
Declaration
Parameters
storage
persistence interface for storing pairings, secrets
accessory
accessory to publish
- Optional Parameters:
-
Undocumented
Declaration
Swift
public private(set) var accessories: [Accessory] { get }
-
Verifies whether this device can add the given accessory.
Declaration
Swift
public func canAddAccessory(accessory: Accessory) -> Bool
Parameters
accessory
Return Value
-
Add an array of accessories to this bridge device.
It is an error to try and add accessories with duplicate serial numbers. It is an error to try and add accessories to a non-bridge device. It is an error to try and increase the number of accessories above 99.
Declaration
Swift
public func addAccessories(_ newAccessories: [Accessory])
-
Undocumented
Declaration
Swift
public func removeAccessories(_ unwantedAccessories: [Accessory], andForgetSerialNumbers: Bool = false)
-
The device’s pairing state.
Declaration
Swift
public private(set) var pairingState: PairingState { get set }
-
Undocumented
Declaration
Swift
public var isPaired: Bool { get }
-
Undocumented
Declaration
Swift
public func removeAllPairings()