Hue
public class Hue
Undocumented
-
Describes a Hue domain error
See moreDeclaration
Swift
public enum Error : Swift.Error
-
Describes a response given while attempting to whitelist a new username.
See moreDeclaration
Swift
public enum ConnectResponse
-
The host URL of the bridge, including scheme.
Declaration
Swift
public let bridgeURL: String
-
The whitelisted username, if present.
Declaration
Swift
public var username: String?
-
Create an instance of the
Declaration
Swift
public init(bridgeURL: String, username: String? = nil)
Parameters
bridgeURL
The host URL of the bridge, including scheme, e.g. https://10.1.2.3/
username
Optional username. If not specified, use
connect()
to generate a new one -
Requests a new whitelisted user ID from the bridge.
Declaration
Swift
public func link() -> AnyPublisher<Hue.ConnectResponse, Hue.Error>
-
Sets the state of a light and publishes the result
Declaration
Swift
public func light(id: String, state: Bool) -> AnyPublisher<[LightState], Hue.Error>
Parameters
id
The ID of the light
state
The new state of the light
-
Sets the state of a group and publishes the result
Declaration
Swift
public func group(id: String, state: Bool) -> AnyPublisher<[GroupState], Hue.Error>
Parameters
id
The ID of the group
state
The new state of the group