Condition

struct Condition
extension Condition : Copyable, Equatable, Escapable, Hashable, Identifiable, Node, Sendable

Base struct for all Conditions in the automation graph.

  • id

    The stable identity of the entity associated with this instance.

    Declaration

    Swift

    let id: String
  • The expression that determines whether the condition passes or not.

    If the expression evaluates to true, the condition passes and the automation continues to execute. Otherwie, the condition evaluation fails and stops executing the automation.

    Declaration

    Swift

    let expression: any Expression
  • The duration the condition should be true for before proceeding.

    Declaration

    Swift

    let duration: Duration?
  • Returns a Boolean value indicating whether two values are equal.

    Equality is the inverse of inequality. For any values a and b, a == b implies that a != b is false.

    Declaration

    Swift

    static func == (lhs: Condition, rhs: Condition) -> Bool

    Parameters

    lhs

    A value to compare.

    rhs

    Another value to compare.

  • Returns true if the nodes are equal, false otherwise.

    Declaration

    Swift

    func isEqual(to other: any Node) -> Bool