This is the default server implementation of PowerSourceBehavior.

Hierarchy (view full)

Constructors

Properties

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

The implemented cluster.

context: ActionContext
endpoint: Endpoint<Empty>
events: EventEmitter & Omit<Events, never> & {
    description$Changing: ClusterEvents.AttributeObservable<FixedAttribute<string, any>>;
    endpointList$Changing: ClusterEvents.AttributeObservable<Attribute<EndpointNumber[], any>>;
    order$Changing: ClusterEvents.AttributeObservable<Attribute<number, any>>;
    status$Changing: ClusterEvents.AttributeObservable<Attribute<PowerSource.PowerSourceStatus, any>>;
} & {} & {
    description$Changed: ClusterEvents.AttributeObservable<FixedAttribute<string, any>>;
    endpointList$Changed: ClusterEvents.AttributeObservable<Attribute<EndpointNumber[], any>>;
    order$Changed: ClusterEvents.AttributeObservable<Attribute<number, any>>;
    status$Changed: ClusterEvents.AttributeObservable<Attribute<PowerSource.PowerSourceStatus, any>>;
} & {} & {} & {}

Access the behavior's events.

features: TypeFromBitSchema<{
    battery: BitFlag;
    rechargeable: BitFlag;
    replaceable: BitFlag;
    wired: BitFlag;
}>

Supported features as a flag object.

Type declaration

  • Readonlybattery: BitFlag

    Battery

    A battery power source

  • Readonlyrechargeable: BitFlag

    Rechargeable

    A rechargeable battery power source

  • Readonlyreplaceable: BitFlag

    Replaceable

    A replaceable battery power source

  • Readonlywired: BitFlag

    Wired

    A wired power source

session: SecureSession
state: Omit<{}, never> & {
    endpointList: EndpointNumber[];
    order: number;
    status: PowerSource.PowerSourceStatus;
} & {} & {
    description: string;
} & {}

Access the behavior's state.

Type declaration

  • ReadonlyendpointList: EndpointNumber[]

    Indicates a list of endpoints that are powered by the source defined by this cluster. Multiple instances of this cluster may list the same endpoint, because it is possible for power for an endpoint to come from multiple sources. In that case the Order attribute indicates their priority.

    For each power source on a node, there shall only be one instance of this cluster.

    A cluster instance with an empty list shall indicate that the power source is for the entire node, which includes all endpoints.

    A cluster instance with a non-empty list shall include the endpoint, upon which the cluster instance resides.

    The above rules allow that some endpoints can have an unknown power source, and therefore would not be indicated by any instance of this cluster.

    Empty list examples

    Typically, there is one power source for the node. Also common is mains power for the node with battery backup power for the node. In both these common cases, for each cluster instance described, the list is empty.

    Populated list example

    A node has a mains power source with Order as 0 (zero), but some application endpoints (not all) have a battery back up source with Order as 1, which means this list is empty for the Power Source cluster associated with the mains power, because it indicates the entire node, but the Power Source cluster instance associated with the battery backup would list the endpoints that have a battery backup.

    MatterSpecification.v13.Core § 11.7.7.32

  • Readonlyorder: number

    Indicates the relative preference with which the Node will select this source to provide power. A source with a lower order shall be selected by the Node to provide power before any other source with a higher order, if the lower order source is available (see Status).

    Note, Order is read-only and therefore NOT intended to allow clients control over power source selection.

    MatterSpecification.v13.Core § 11.7.7.2

  • Readonlystatus: PowerSource.PowerSourceStatus

    Indicates the participation of this power source in providing power to the Node as specified in PowerSourceStatusEnum.

    MatterSpecification.v13.Core § 11.7.7.1

Type declaration

  • Readonlydescription: string

    This attribute shall provide a user-facing description of this source, used to distinguish it from other power sources, e.g. "DC Power", "Primary Battery" or "Battery back-up". This attribute shall NOT be used to convey information such as battery form factor, or chemistry.

    MatterSpecification.v13.Core § 11.7.7.3

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

defaults: ClusterState.Type<PowerSource.Cluster, typeof ClusterBehavior>
dependencies?: Iterable<Type, any, any>
early: boolean
Events: ClusterEvents.Type<PowerSource.Cluster, typeof ClusterBehavior>
ExtensionInterface: {}
id

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

Interface: {
    components: never[];
}
Internal: (new () => {})
name: string
schema?: Schema
State: (new () => ClusterState.Type<PowerSource.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

  • 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