This is the default server implementation of DescriptorBehavior.

Hierarchy (view full)

Constructors

  • Parameters

    • agent: Agent
    • backing: BehaviorBacking

    Returns DescriptorServer

Properties

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

The implemented cluster.

context: ActionContext
endpoint: Endpoint<Empty>
events: EventEmitter & Omit<Events, never> & {
    clientList$Changing: ClusterEvents.AttributeObservable<FixedAttribute<ClusterId[], any>>;
    deviceTypeList$Changing: ClusterEvents.AttributeObservable<FixedAttribute<TypeFromFields<{
        deviceType: FieldType<DeviceTypeId>;
        revision: FieldType<number>;
    }>[], any>>;
    partsList$Changing: ClusterEvents.AttributeObservable<Attribute<EndpointNumber[], any>>;
    serverList$Changing: ClusterEvents.AttributeObservable<FixedAttribute<ClusterId[], any>>;
} & {} & {
    clientList$Changed: ClusterEvents.AttributeObservable<FixedAttribute<ClusterId[], any>>;
    deviceTypeList$Changed: ClusterEvents.AttributeObservable<FixedAttribute<TypeFromFields<{
        deviceType: FieldType<DeviceTypeId>;
        revision: FieldType<number>;
    }>[], any>>;
    partsList$Changed: ClusterEvents.AttributeObservable<Attribute<EndpointNumber[], any>>;
    serverList$Changed: ClusterEvents.AttributeObservable<FixedAttribute<ClusterId[], any>>;
} & {} & {} & {}

Access the behavior's events.

features: TypeFromBitSchema<{
    tagList: BitFlag;
}>

Supported features as a flag object.

Type declaration

  • ReadonlytagList: BitFlag

    TagList

    See the Disambiguation section in the System Model spec for conformance requirements for this feature and the corresponding attribute.

    MatterSpecification.v13.Core § 9.5.4.1

session: SecureSession
state: Omit<{}, never> & {
    partsList: EndpointNumber[];
} & {} & {
    clientList: ClusterId[];
    deviceTypeList: TypeFromFields<{
        deviceType: FieldType<DeviceTypeId>;
        revision: FieldType<number>;
    }>[];
    serverList: ClusterId[];
} & {}

Access the behavior's state.

Type declaration

  • ReadonlypartsList: EndpointNumber[]

    This attribute indicates composition of the device type instance. Device type instance composition shall include the endpoints in this list.

    See Endpoint Composition for more information about which endpoints to include in this list.

    MatterSpecification.v13.Core § 9.5.6.4

Type declaration

  • ReadonlyclientList: ClusterId[]

    This attribute shall list each cluster ID for the client clusters present on the endpoint instance.

    MatterSpecification.v13.Core § 9.5.6.3

  • ReadonlydeviceTypeList: TypeFromFields<{
        deviceType: FieldType<DeviceTypeId>;
        revision: FieldType<number>;
    }>[]

    This is a list of device types and corresponding revisions declaring endpoint conformance (see DeviceTypeStruct). At least one device type entry shall be present.

    An endpoint shall conform to all device types listed in the DeviceTypeList. A cluster instance that is in common for more than one device type in the DeviceTypeList shall be supported as a shared cluster instance on the endpoint.

    MatterSpecification.v13.Core § 9.5.6.1

  • ReadonlyserverList: ClusterId[]

    This attribute shall list each cluster ID for the server clusters present on the endpoint instance.

    MatterSpecification.v13.Core § 9.5.6.2

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

defaults: ClusterState.Type<Descriptor.Cluster, typeof ClusterBehavior>
dependencies: typeof IndexBehavior[]
early: boolean
Events: ClusterEvents.Type<Descriptor.Cluster, typeof ClusterBehavior>
ExtensionInterface: {}
id

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

Interface: {
    components: never[];
}
Internal: (new () => {})

Type declaration

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

      Returns {}

    name: string
    schema?: Schema
    State: (new () => ClusterState.Type<Descriptor.Cluster, typeof ClusterBehavior>)
    supervisor: RootSupervisor
    supports: ((other: Type) => boolean)

    Type declaration

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

        Parameters

        Returns boolean

    Methods

    • Extend device type metadata. This is a shortcut for deduped insert into the deviceTypeList cluster attribute.

      Parameters

      Returns void

    • Add semantic tags. This is a shortcut for deduped insert into the tagList cluster attribute.

      You must enable the "TagList" feature to use this method.

      Parameters

      Returns 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

    • Check for presence of a device type.

      Parameters

      Returns boolean

    • 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 Promise<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

    • Type Parameters

      Parameters

      Returns This