ValueMutation
public struct ValueMutation : Codable
Value mutation.
This struct provides an abstrated way of building mutations for a device’s state.
-
Initialize a new
ValueMutationinstance that sets a value within an optional duration.For example, use this to change the brightness to 20% over a duration of 30 seconds.
Declaration
Swift
public init(value: Double, duration: TimeInterval? = nil)Parameters
valueThe value.
durationThe duration.
-
Initialize a new
ValueMutationinstance that increments the value by the given amount.Declaration
Swift
public init(increment: Double)Parameters
incrementThe amount to increment by.
-
Initialize a new
ValueMutationinstance that decrements the value by the given amount.Declaration
Swift
public init(decrement: Double)Parameters
decrementThe amount to decrement by.
ValueMutation Structure Reference