This is the default server implementation of RvcOperationalStateBehavior.

Hierarchy (view full)

Constructors

  • Parameters

    • agent: Agent
    • backing: BehaviorBacking

    Returns RvcOperationalStateServer

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> & {
    currentPhase$Changing: ClusterEvents.AttributeObservable<Attribute<null | number, any>>;
    operationalError$Changing: ClusterEvents.AttributeObservable<Attribute<TypeFromFields<{
        errorStateDetails: OptionalFieldType<string>;
        errorStateId: FieldType<number>;
        errorStateLabel: OptionalFieldType<string>;
    }>, any>>;
    operationalState$Changing: ClusterEvents.AttributeObservable<Attribute<number, any>>;
    operationalStateList$Changing: ClusterEvents.AttributeObservable<Attribute<TypeFromFields<{
        operationalStateId: FieldType<number>;
        operationalStateLabel: OptionalFieldType<string>;
    }>[], any>>;
    phaseList$Changing: ClusterEvents.AttributeObservable<Attribute<null | string[], any>>;
} & {
    countdownTime$Changing: undefined | ClusterEvents.AttributeObservable<OptionalAttribute<null | number, any>>;
} & {
    currentPhase$Changed: ClusterEvents.AttributeObservable<Attribute<null | number, any>>;
    operationalError$Changed: ClusterEvents.AttributeObservable<Attribute<TypeFromFields<{
        errorStateDetails: OptionalFieldType<string>;
        errorStateId: FieldType<number>;
        errorStateLabel: OptionalFieldType<string>;
    }>, any>>;
    operationalState$Changed: ClusterEvents.AttributeObservable<Attribute<number, any>>;
    operationalStateList$Changed: ClusterEvents.AttributeObservable<Attribute<TypeFromFields<{
        operationalStateId: FieldType<number>;
        operationalStateLabel: OptionalFieldType<string>;
    }>[], any>>;
    phaseList$Changed: ClusterEvents.AttributeObservable<Attribute<null | string[], any>>;
} & {
    countdownTime$Changed: undefined | ClusterEvents.AttributeObservable<OptionalAttribute<null | number, any>>;
} & {
    operationalError: ClusterEvents.EventObservable<Event<TypeFromFields<{
        errorState: FieldType<TypeFromFields<{
            errorStateDetails: OptionalFieldType<string>;
            errorStateId: FieldType<number>;
            errorStateLabel: OptionalFieldType<string>;
        }>>;
    }>, any>>;
} & {
    operationCompletion?: ClusterEvents.EventObservable<OptionalEvent<TypeFromFields<{
        completionErrorCode: FieldType<number>;
        pausedTime: OptionalFieldType<null | number>;
        totalOperationalTime: OptionalFieldType<null | number>;
    }>, any>>;
}

Access the behavior's events.

Type declaration

  • ReadonlyoperationalError: ClusterEvents.EventObservable<Event<TypeFromFields<{
        errorState: FieldType<TypeFromFields<{
            errorStateDetails: OptionalFieldType<string>;
            errorStateId: FieldType<number>;
            errorStateLabel: OptionalFieldType<string>;
        }>>;
    }>, any>>

    This event is generated when a reportable error condition is detected. A device that generates this event shall also set the OperationalState attribute to Error, indicating an error condition.

    This event shall contain the following fields:

    MatterSpecification.v13.Cluster § 1.14.7.1

Type declaration

  • Optional ReadonlyoperationCompletion?: ClusterEvents.EventObservable<OptionalEvent<TypeFromFields<{
        completionErrorCode: FieldType<number>;
        pausedTime: OptionalFieldType<null | number>;
        totalOperationalTime: OptionalFieldType<null | number>;
    }>, any>>

    This event is generated when the overall operation ends, successfully or otherwise. For example, the completion of a cleaning operation in a Robot Vacuum Cleaner, or the completion of a wash cycle in a Washing Machine.

    This event shall contain the following fields:

    MatterSpecification.v13.Cluster § 1.14.7.2

features: TypeFromBitSchema<{}>

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> & {
    currentPhase: null | number;
    operationalError: TypeFromFields<{
        errorStateDetails: OptionalFieldType<string>;
        errorStateId: FieldType<number>;
        errorStateLabel: OptionalFieldType<string>;
    }>;
    operationalState: number;
    operationalStateList: TypeFromFields<{
        operationalStateId: FieldType<number>;
        operationalStateLabel: OptionalFieldType<string>;
    }>[];
    phaseList: null | string[];
} & {
    countdownTime?: null | number;
} & {} & {}

Access the behavior's state.

Type declaration

  • ReadonlycurrentPhase: null | number

    This attribute represents the current phase of operation being performed by the server. This shall be the positional index representing the value from the set provided in the PhaseList Attribute, where the first item in that list is an index of 0. Thus, this attribute shall have a maximum value that is "length(PhaseList) - 1".

    Null if the PhaseList attribute is null or if the PhaseList attribute is an empty list.

    MatterSpecification.v13.Cluster § 1.14.5.2

  • ReadonlyoperationalError: TypeFromFields<{
        errorStateDetails: OptionalFieldType<string>;
        errorStateId: FieldType<number>;
        errorStateLabel: OptionalFieldType<string>;
    }>

    This attribute shall specify the details of any current error condition being experienced on the device when the OperationalState attribute is populated with Error. Please see ErrorStateStruct for general requirements on the population of this attribute.

    When there is no error detected, this shall have an ErrorStateID of NoError.

    MatterSpecification.v13.Cluster § 1.14.5.6

  • ReadonlyoperationalState: number

    This attribute specifies the current operational state of a device. This shall be populated with a valid OperationalStateID from the set of values in the OperationalStateList Attribute.

    MatterSpecification.v13.Cluster § 1.14.5.5

  • ReadonlyoperationalStateList: TypeFromFields<{
        operationalStateId: FieldType<number>;
        operationalStateLabel: OptionalFieldType<string>;
    }>[]

    This attribute describes the set of possible operational states that the device exposes. An operational state is a fundamental device state such as Running or Error. Details of the phase of a device when, for example, in a state of Running are provided by the CurrentPhase attribute.

    All devices shall, at a minimum, expose the set of states matching the commands that are also supported by the cluster instance, in addition to Error. The set of possible device states are defined in the OperationalStateEnum. A device type requiring implementation of this cluster shall define the set of states that are applicable to that specific device type.

    MatterSpecification.v13.Cluster § 1.14.5.4

  • ReadonlyphaseList: null | string[]

    Indicates a list of names of different phases that the device can go through for the selected function or mode. The list may not be in sequence order. For example in a washing machine this could include items such as "pre-soak", "rinse", and "spin". These phases are manufacturer specific and may change when a different function or mode is selected.

    A null value indicates that the device does not present phases during its operation. When this attribute’s value is null, the CurrentPhase attribute shall also be set to null.

    MatterSpecification.v13.Cluster § 1.14.5.1

Type declaration

  • Optional ReadonlycountdownTime?: null | number

    Indicates the estimated time left before the operation is completed, in seconds. Changes to this value shall NOT be reported in a subscription (note the C Quality). A Client implementation may periodically poll this value to ensure alignment of any local rendering of the CountdownTime with the device provided value.

    A value of 0 means that the operation has completed.

    When this attribute is null, that represents that there is no time currently defined until operation completion. This may happen, for example, because no operation is in progress or because the completion time is unknown.

    MatterSpecification.v13.Cluster § 1.14.5.3

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

defaults: ClusterState.Type<RvcOperationalState.Cluster, Type<Of<{
    attributes: {};
    commands: {};
    events: {};
    id: 0;
    name: "Unknown";
    revision: 0;
}>, typeof ClusterBehavior, RvcOperationalStateInterface>>
dependencies?: Iterable<Type, any, any>
early: boolean
Events: ClusterEvents.Type<RvcOperationalState.Cluster, Type<Of<{
    attributes: {};
    commands: {};
    events: {};
    id: 0;
    name: "Unknown";
    revision: 0;
}>, typeof ClusterBehavior, RvcOperationalStateInterface>>
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<RvcOperationalState.Cluster, Type<Of<{
        attributes: {};
        commands: {};
        events: {};
        id: 0;
        name: "Unknown";
        revision: 0;
    }>, typeof ClusterBehavior, RvcOperationalStateInterface>>)
    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

    • On receipt of this command, the device shall start seeking the charging dock, if possible in the current state of the device.

      If this command is received when already in the SeekingCharger state the device shall respond with an OperationalCommandResponse command with an ErrorStateID of NoError but the command shall have no other effect.

      A device that receives this command in any state which does not allow seeking the charger, such as Charging or Docked, shall respond with an OperationalCommandResponse command with an ErrorStateID of CommandInvalidInState and shall have no other effect.

      Otherwise, on success:

      • The OperationalState attribute shall be set to SeekingCharger.

      • The device shall respond with an OperationalCommandResponse command with an ErrorStateID of NoError.

      Returns MaybePromise<OperationalState.OperationalCommandResponse>

      MatterSpecification.v13.Cluster § 7.4.5.1

    • 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

      • Description used in diagnostic messages.

        Returns string

      • Type Parameters

        Parameters

        Returns This