This is the default server implementation of ValveConfigurationAndControlBehavior.

Hierarchy (view full)

Constructors

Properties

[reference]: Datasource<StateType>
agent: Agent
cluster: never

The implemented cluster.

context: ActionContext
endpoint: Endpoint<Empty>
events: EventEmitter & Omit<ClusterEvents<Of<{
    attributes: {};
    commands: {};
    events: {};
    id: 0;
    name: "Unknown";
    revision: 0;
}>, typeof ClusterBehavior>, never> & {
    currentState$Changing: ClusterEvents.AttributeObservable<Attribute<null | ValveConfigurationAndControl.ValveState, any>>;
    defaultOpenDuration$Changing: ClusterEvents.AttributeObservable<WritableAttribute<null | number, any>>;
    openDuration$Changing: ClusterEvents.AttributeObservable<Attribute<null | number, any>>;
    remainingDuration$Changing: ClusterEvents.AttributeObservable<Attribute<null | number, any>>;
    targetState$Changing: ClusterEvents.AttributeObservable<Attribute<null | ValveConfigurationAndControl.ValveState, any>>;
} & {
    valveFault$Changing: undefined | ClusterEvents.AttributeObservable<OptionalAttribute<TypeFromPartialBitSchema<{
        blocked: BitFlag;
        currentExceeded: BitFlag;
        generalFault: BitFlag;
        leaking: BitFlag;
        notConnected: BitFlag;
        shortCircuit: BitFlag;
    }>, any>>;
} & {
    currentState$Changed: ClusterEvents.AttributeObservable<Attribute<null | ValveConfigurationAndControl.ValveState, any>>;
    defaultOpenDuration$Changed: ClusterEvents.AttributeObservable<WritableAttribute<null | number, any>>;
    openDuration$Changed: ClusterEvents.AttributeObservable<Attribute<null | number, any>>;
    remainingDuration$Changed: ClusterEvents.AttributeObservable<Attribute<null | number, any>>;
    targetState$Changed: ClusterEvents.AttributeObservable<Attribute<null | ValveConfigurationAndControl.ValveState, any>>;
} & {
    valveFault$Changed: undefined | ClusterEvents.AttributeObservable<OptionalAttribute<TypeFromPartialBitSchema<{
        blocked: BitFlag;
        currentExceeded: BitFlag;
        generalFault: BitFlag;
        leaking: BitFlag;
        notConnected: BitFlag;
        shortCircuit: BitFlag;
    }>, any>>;
} & {} & {
    valveFault?: ClusterEvents.EventObservable<OptionalEvent<TypeFromFields<{
        valveFault: FieldType<TypeFromPartialBitSchema<{
            blocked: BitFlag;
            currentExceeded: BitFlag;
            generalFault: BitFlag;
            leaking: BitFlag;
            notConnected: BitFlag;
            shortCircuit: BitFlag;
        }>>;
    }>, any>>;
    valveStateChanged?: ClusterEvents.EventObservable<OptionalEvent<TypeFromFields<{
        valveLevel: OptionalFieldType<number>;
        valveState: FieldType<ValveConfigurationAndControl.ValveState>;
    }>, any>>;
}

Access the behavior's events.

Type declaration

features: TypeFromBitSchema<{}> & TypeFromBitSchema<{
    level: BitFlag;
    timeSync: BitFlag;
}>

Supported features as a flag object.

session: SecureSession
state: Omit<ClusterState.Type<Of<{
    attributes: {};
    commands: {};
    events: {};
    id: 0;
    name: "Unknown";
    revision: 0;
}>, typeof ClusterBehavior>, never> & {
    currentState: null | ValveConfigurationAndControl.ValveState;
    defaultOpenDuration: null | number;
    openDuration: null | number;
    remainingDuration: null | number;
    targetState: null | ValveConfigurationAndControl.ValveState;
} & {
    valveFault?: TypeFromPartialBitSchema<{
        blocked: BitFlag;
        currentExceeded: BitFlag;
        generalFault: BitFlag;
        leaking: BitFlag;
        notConnected: BitFlag;
        shortCircuit: BitFlag;
    }>;
} & {} & {}

Access the behavior's state.

Type declaration

  • ReadonlycurrentState: null | ValveConfigurationAndControl.ValveState

    Indicates the current state of the valve.

    A value of null shall indicate that the current state is not known.

    MatterSpecification.v13.Cluster § 4.6.7.5

  • ReadonlydefaultOpenDuration: null | number

    Indicates the default duration, in seconds, for which the valve will remain open, if the OpenDuration field is not present in the Open command.

    A value of null shall indicate the duration is not set, meaning that the valve will remain open until closed by the user or some other automation.

    MatterSpecification.v13.Cluster § 4.6.7.2

  • ReadonlyopenDuration: null | number

    Indicates the total duration, in seconds, for which the valve will remain open for this current opening.

    A value of null shall indicate the duration is not set, meaning that the valve will remain open until closed by the user or some other automation.

    MatterSpecification.v13.Cluster § 4.6.7.1

  • ReadonlyremainingDuration: null | number

    Indicates the remaining duration, in seconds, until the valve closes. Null:

    • When OpenDuration is null, or

    • When the valve is closed.

    The value of this attribute shall only be reported in the following cases:

    • When it changes from null to any other value and vice versa, or

    • When it changes to 0, or

    • When it increases, or

    • When the closing time changes.

    Meaning that clients SHOULD NOT rely on the reporting of this attribute in order to keep track of the remaining duration, due to this attribute not being reported during regular countdown.

    When reading this attribute it shall return the remaining duration, in seconds, until the valve closes.

    When the value of this attribute counts down to 0, the valve shall automatically transition to its closed position. The behavior of transitioning to the closed position shall match the behavior described in the Close command.

    MatterSpecification.v13.Cluster § 4.6.7.4

  • ReadonlytargetState: null | ValveConfigurationAndControl.ValveState

    Indicates the target state, while changing the state, of the valve.

    A value of null shall indicate that no target position is set, since the change in state is either done or failed.

    MatterSpecification.v13.Cluster § 4.6.7.6

Type declaration

  • Optional ReadonlyvalveFault?: TypeFromPartialBitSchema<{
        blocked: BitFlag;
        currentExceeded: BitFlag;
        generalFault: BitFlag;
        leaking: BitFlag;
        notConnected: BitFlag;
        shortCircuit: BitFlag;
    }>

    Indicates any faults registered by the valve.

    MatterSpecification.v13.Cluster § 4.6.7.10

Base cluster state include all attribute values but may be extended by subclasses.

defaults: ClusterState.Type<ValveConfigurationAndControl.Cluster, Type<Of<{
    attributes: {};
    commands: {};
    events: {};
    id: 0;
    name: "Unknown";
    revision: 0;
}>, typeof ClusterBehavior, ValveConfigurationAndControlInterface>>
dependencies?: Iterable<Type, any, any>
early: boolean
Events: ClusterEvents.Type<ValveConfigurationAndControl.Cluster, Type<Of<{
    attributes: {};
    commands: {};
    events: {};
    id: 0;
    name: "Unknown";
    revision: 0;
}>, typeof ClusterBehavior, ValveConfigurationAndControlInterface>>
ExtensionInterface: {}
id

The behavior ID for ClusterBehaviors is the name of the cluster.

Internal: (new () => {})

Type declaration

    • new (): {}
    • Implementation of internal state. Subclasses may override to extend.

      Returns {}

    name: string
    schema?: Schema
    State: (new () => ClusterState.Type<ValveConfigurationAndControl.Cluster, Type<Of<{
        attributes: {};
        commands: {};
        events: {};
        id: 0;
        name: "Unknown";
        revision: 0;
    }>, typeof ClusterBehavior, ValveConfigurationAndControlInterface>>)
    supervisor: RootSupervisor
    supports: ((other: Type) => boolean)

    Type declaration

      • (other): boolean
      • Does this behavior support functionality of a specific implementation?

        Parameters

        Returns boolean

    Methods

    • Execute logic with elevated privileges.

      The provided function executes with privileges escalated to offline mode. This is not commonly necessary.

      Elevated logic effectively ignores ACLs so should be used with care.

      Note that interactions with the behavior will remain elevated until the synchronous completion of this call. You should only elevate privileges for synchronous logic.

      Parameters

      • fn: (() => void)

        the elevated logic

          • (): void
          • Returns void

      Returns void

    • Create a generic callback function that has the same properties as a Reactor.

      Like a reactor, the callback's "this" will be bound to an active Behavior instance. Because of this: The reactor MUST be a real JS function - arrow functions will not work!

      Type Parameters

      • A extends any[]
      • R

      Parameters

      Returns ((...args: A) => undefined | R)

        • (...args): undefined | R
        • Parameters

          • Rest...args: A

          Returns undefined | R

    • This command is used to set the valve to its closed position.

      Returns MaybePromise

      MatterSpecification.v13.Cluster § 4.6.8.2

    • Behaviors are ephemeral and should not perform initialization in their constructor. They can override this method instead.

      This method may be synchronous or asyncronous. If asynchronous, the behavior will not be available for external use until initialization completes.

      Parameters

      • Optional_options: {}

        Returns MaybePromise

      • Install a Reactor.

        Important: The reactor MUST be a real JS function - arrow functions will not work!

        Type Parameters

        Parameters

        Returns void

      • Type Parameters

        Parameters

        Returns This