UpdateStateRequest
public struct UpdateStateRequest : HTTPRequest
Update a device’s state.
This request can be used to update the device’s:
- On/off status.
- Brightness.
- Hue.
- Saturation.
- Color temperature.
-
Declaration
Swift
public typealias ResponseObject = Void
-
Declaration
Swift
public typealias ErrorObject = APIError
-
Declaration
Swift
public let baseURL: URL
-
Declaration
Swift
public var method: HTTPMethod { get }
-
Declaration
Swift
public var path: String { get }
-
Declaration
Swift
public var isAuthenticated: Bool { get }
-
Declaration
Swift
public var body: Data?
-
Initialize a new instance.
Declaration
Swift
public init( url: URL, token: String, isOn: Bool? = nil, brightness: ValueMutation? = nil, hue: ValueMutation? = nil, saturation: ValueMutation? = nil, colorTemperature: ValueMutation? = nil ) throws
Parameters
url
The device’s URL.
token
The device’s token.
isOn
The on/off state.
brightness
The brightness mutation.
hue
The hue mutation.
saturation
The saturation mutation.
colorTemperature
The color temperature mutation.