Hue

public class Hue

Undocumented

  • Describes a Hue domain error

    See more

    Declaration

    Swift

    public enum Error : Swift.Error
  • Describes a response given while attempting to whitelist a new username.

    See more

    Declaration

    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>

Collections

  • Publishes all available lights for the hub

    Declaration

    Swift

    public func lights() -> AnyPublisher<Lights, Hue.Error>
  • Publishes all available groups for the hub

    Declaration

    Swift

    public func groups() -> AnyPublisher<Groups, Hue.Error>
  • Publishes the full config for the hub

    Declaration

    Swift

    public func config() -> AnyPublisher<Config, Hue.Error>
  • Publishes all available schedules for the hub

    Declaration

    Swift

    public func schedules() -> AnyPublisher<Schedules, Hue.Error>
  • Publishes all available scenes for the hub

    Declaration

    Swift

    public func scenes() -> AnyPublisher<Scenes, Hue.Error>
  • Publishes all available sensors for the hub

    Declaration

    Swift

    public func sensors() -> AnyPublisher<Sensors, Hue.Error>

Elements

  • Publishes the Light with the given ID

    Declaration

    Swift

    public func light(id: String) -> AnyPublisher<Lights.Light, Hue.Error>

    Parameters

    id

    The ID of the Light to publish

  • 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

  • Publishes the Group with the given ID

    Declaration

    Swift

    public func group(id: String) -> AnyPublisher<Groups.Group, Hue.Error>

    Parameters

    id

    The ID of the Group to publish

  • 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

  • Publishes the Schedule with the given ID

    Declaration

    Swift

    public func schedule(id: String) -> AnyPublisher<Schedules.Schedule, Hue.Error>

    Parameters

    id

    The ID of the Schedule to publish

  • Publishes the Scene with the given ID

    Declaration

    Swift

    public func scene(id: String) -> AnyPublisher<Scenes.Scene, Hue.Error>

    Parameters

    id

    The ID of the Scene to publish

  • Publishes the Sensor with the given ID

    Declaration

    Swift

    public func sensor(id: String) -> AnyPublisher<Sensors.Sensor, Hue.Error>

    Parameters

    id

    The ID of the Sensor to publish