This is the default server implementation of OperationalStateBehavior.

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

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

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

Type declaration

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

      Parameters

      Returns boolean

Methods

  • 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 shall be supported if the device supports remotely pausing the operation. If this command is supported, the Resume command shall also be supported.

    On receipt of this command, the device shall pause its operation if it is possible based on the current function of the server. For example, if it is at a point where it is safe to do so and/or permitted, but can be restarted from the point at which pause occurred.

    If this command is received when already in the Paused state the device shall respond with an OperationalCommandResponse command with an ErrorStateID of NoError but take no further action.

    A device that receives this command in any state which is not Pause-compatible shall respond

    with an OperationalCommandResponse command with an ErrorStateID of CommandInvalidInState and shall take no further action.

    States are defined as Pause-compatible as follows:

    • For states defined in this cluster specification, in Table 3, “Pause Compatibility”.

    • For states defined by derived cluster specifications, in the corresponding specifications.

    • For manufacturer-specific states, by the manufacturer.

    A device that is unable to honor the Pause command for whatever reason shall respond with an OperationalCommandResponse command with an ErrorStateID of CommandInvalidInState but take no further action.

    Otherwise, on success:

    • The OperationalState attribute shall be set to Paused.

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

    The following table defines the compatibility of this cluster’s states with the Pause command.

    Returns MaybePromise<OperationalState.OperationalCommandResponse>

    MatterSpecification.v13.Cluster § 1.14.6.1

  • This command shall be supported if the device supports remotely resuming the operation. If this command is supported, the Pause command shall also be supported.

    On receipt of this command, the device shall resume its operation from the point it was at when it received the Pause command, or from the point when it was paused by means outside of this cluster (for example by manual button press).

    If this command is received when already in the Running state the device shall respond with an OperationalCommandResponse command with an ErrorStateID of NoError but take no further action.

    A device that receives this command in any state which is not Resume-compatible shall respond with an OperationalCommandResponse command with an ErrorStateID of CommandInvalidInState and shall take no further action.

    States are defined as Resume-compatible as follows:

    • For states defined in this cluster specification, in Table 4, “Resume Compatibility”.

    • For states defined by derived cluster specifications, in the corresponding specifications.

    • For manufacturer-specific states, by the manufacturer.

    The following table defines the compatibility of this cluster’s states with the Resume command.

    A device that is unable to honor the Resume command for any other reason shall respond with an OperationalCommandResponse command with an ErrorStateID of UnableToStartOrResume but take no further action.

    Otherwise, on success:

    • The OperationalState attribute shall be set to the most recent non-Error operational state prior to entering the Paused state.

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

    Returns MaybePromise<OperationalState.OperationalCommandResponse>

    MatterSpecification.v13.Cluster § 1.14.6.4

  • This command shall be supported if the device supports remotely starting the operation. If this command is supported, the 'Stop command shall also be supported.

    On receipt of this command, the device shall start its operation if it is safe to do so and the device is in an operational state from which it can be started. There may be either regulatory or manufacturer-imposed safety and security requirements that first necessitate some specific action at the device before a Start command can be honored. In such instances, a device shall respond with a status code of CommandInvalidInState if a Start command is received prior to the required on- device action.

    If this command is received when already in the Running state the device shall respond with an OperationalCommandResponse command with an ErrorStateID of NoError but take no further action.

    A device that is unable to honor the Start command for whatever reason shall respond with an OperationalCommandResponse command with an ErrorStateID of UnableToStartOrResume but take no further action.

    Otherwise, on success:

    • The OperationalState attribute shall be set to Running.

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

    Returns MaybePromise<OperationalState.OperationalCommandResponse>

    MatterSpecification.v13.Cluster § 1.14.6.3

  • This command shall be supported if the device supports remotely stopping the operation.

    On receipt of this command, the device shall stop its operation if it is at a position where it is safe to do so and/or permitted. Restart of the device following the receipt of the Stop command shall require attended operation unless remote start is allowed by the device type and any jurisdiction governing remote operation of the device.

    If this command is received when already in the Stopped state the device shall respond with an OperationalCommandResponse command with an ErrorStateID of NoError but take no further action.

    A device that is unable to honor the Stop command for whatever reason shall respond with an OperationalCommandResponse command with an ErrorStateID of CommandInvalidInState but take no further action.

    Otherwise, on success:

    • The OperationalState attribute shall be set to Stopped.

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

    Returns MaybePromise<OperationalState.OperationalCommandResponse>

    MatterSpecification.v13.Cluster § 1.14.6.2