This is the default server implementation of IdentifyBehavior.

This implementation includes all features of Identify.Cluster and implements all mandatory commands. You should use IdentifyServer.with to specialize the class for the features your implementation supports. Alternatively you can extend this class and override the methods you need to change or add mandatory commands.

Beside the standard state values the following additional state values are available:

  • isIdentifying - Indicates if the device is currently identifying.

Beside the standard events the following additional events are available:

  • startIdentifying - Emitted when the device starts identifying. Use it e.g to start your own identifying logic.
  • stopIdentifying - Emitted when the device stops identifying.

Hierarchy (view full)

Constructors

  • Parameters

    • agent: Agent
    • backing: BehaviorBacking

    Returns IdentifyServer

Properties

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

The implemented cluster.

context: ActionContext
endpoint: Endpoint<Empty>
events: Events

Access the behavior's events.

features: TypeFromBitSchema<{}>

Supported features as a flag object.

internal: Internal
session: SecureSession
state: State

Access the behavior's state.

cluster: Identify.Cluster

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

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

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

name: string
schema?: Schema
supervisor: RootSupervisor
supports: ((other: Type) => boolean)

Type declaration

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

      Parameters

      Returns boolean

Methods

  • Release resources. This is the public API for releasing application resources held by behaviors in internal state.

    Returns Promise<void>

  • 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

  • Type Parameters

    • This extends Behavior
    • K extends string | number | symbol

    Parameters

    • this: This
    • attributeName: K

    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 starts or stops the receiving device identifying itself.

    Parameters

    Returns void

    MatterSpecification.v13.Cluster § 1.2.6.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.

    Returns void

  • Install a Reactor.

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

    Type Parameters

    Parameters

    Returns void

  • Type Parameters

    • This extends Behavior
    • K extends string | number | symbol

    Parameters

    • this: This
    • attributeName: K

    Returns Exclude<This["state"][K], undefined>

  • Description used in diagnostic messages.

    Returns string

  • This command allows the support of feedback to the user, such as a certain light effect. It is used to allow an implementation to provide visual feedback to the user under certain circumstances such as a color light turning green when it has successfully connected to a network. The use of this command and the effects themselves are entirely up to the implementer to use whenever a visual feedback is useful but it is not the same as and does not replace the identify mechanism used during commissioning.

    Parameters

    Returns MaybePromise

    MatterSpecification.v13.Cluster § 1.2.6.2

  • Type Parameters

    Parameters

    Returns This