ValueMutation

public struct ValueMutation : Codable

Value mutation.

This struct provides an abstrated way of building mutations for a device’s state.

Initialization

  • Initialize a new ValueMutation instance 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

    value

    The value.

    duration

    The duration.

  • Initialize a new ValueMutation instance that increments the value by the given amount.

    Declaration

    Swift

    public init(increment: Double)

    Parameters

    increment

    The amount to increment by.

  • Initialize a new ValueMutation instance that decrements the value by the given amount.

    Declaration

    Swift

    public init(decrement: Double)

    Parameters

    decrement

    The amount to decrement by.