This is the default server implementation of EnergyPreferenceBehavior.

The Matter specification requires the EnergyPreference cluster to support features we do not enable by default. You should use EnergyPreferenceServer.with to specialize the class for the features your implementation supports.

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> & {} & {} & {} & {} & {} & {}

Access the behavior's events.

features: TypeFromBitSchema<{
    energyBalance: BitFlag;
    lowPowerModeSensitivity: BitFlag;
}>

Supported features as a flag object.

Type declaration

  • ReadonlyenergyBalance: BitFlag

    EnergyBalance

    This feature allows a user to select from a list of energy balances with associated descriptions of which strategies a device will use to target the specified balance.

    MatterSpecification.v13.Cluster § 9.5.4.1

  • ReadonlylowPowerModeSensitivity: BitFlag

    LowPowerModeSensitivity

    This feature allows the user to select a condition or set of conditions which will cause the device to switch to a mode using less power. For example, a device might provide a scale of durations that must elapse without user interaction before it goes to sleep.

    MatterSpecification.v13.Cluster § 9.5.4.2

session: SecureSession
state: Omit<{}, never> & {} & {} & {} & {}

Access the behavior's state.

cluster: Of<{
    extensions: readonly [{
        component: {
            attributes: {
                currentEnergyBalance: WritableAttribute<number, any>;
                energyBalances: FixedAttribute<TypeFromFields<{
                    label: OptionalFieldType<(...)>;
                    step: FieldType<(...)>;
                }>[], any>;
                energyPriorities: FixedAttribute<EnergyPreference.EnergyPriority[], any>;
            };
        };
        flags: {
            energyBalance: true;
        };
    }, {
        component: {
            attributes: {
                currentLowPowerModeSensitivity: WritableAttribute<number, any>;
                lowPowerModeSensitivities: FixedAttribute<TypeFromFields<{
                    label: OptionalFieldType<(...)>;
                    step: FieldType<(...)>;
                }>[], any>;
            };
        };
        flags: {
            lowPowerModeSensitivity: true;
        };
    }, {
        component: false;
        flags: {
            energyBalance: false;
            lowPowerModeSensitivity: false;
        };
    }];
    features: {
        energyBalance: BitFlag;
        lowPowerModeSensitivity: BitFlag;
    };
    id: 155;
    name: "EnergyPreference";
    revision: 1;
}>

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

Type declaration

  • Readonlyextensions: readonly [{
        component: {
            attributes: {
                currentEnergyBalance: WritableAttribute<number, any>;
                energyBalances: FixedAttribute<TypeFromFields<{
                    label: OptionalFieldType<(...)>;
                    step: FieldType<(...)>;
                }>[], any>;
                energyPriorities: FixedAttribute<EnergyPreference.EnergyPriority[], any>;
            };
        };
        flags: {
            energyBalance: true;
        };
    }, {
        component: {
            attributes: {
                currentLowPowerModeSensitivity: WritableAttribute<number, any>;
                lowPowerModeSensitivities: FixedAttribute<TypeFromFields<{
                    label: OptionalFieldType<(...)>;
                    step: FieldType<(...)>;
                }>[], any>;
            };
        };
        flags: {
            lowPowerModeSensitivity: true;
        };
    }, {
        component: false;
        flags: {
            energyBalance: false;
            lowPowerModeSensitivity: false;
        };
    }]

    This metadata controls which EnergyPreferenceCluster elements matter.js activates for specific feature combinations.

  • Readonlyfeatures: {
        energyBalance: BitFlag;
        lowPowerModeSensitivity: BitFlag;
    }
    • ReadonlyenergyBalance: BitFlag

      EnergyBalance

      This feature allows a user to select from a list of energy balances with associated descriptions of which strategies a device will use to target the specified balance.

      MatterSpecification.v13.Cluster § 9.5.4.1

    • ReadonlylowPowerModeSensitivity: BitFlag

      LowPowerModeSensitivity

      This feature allows the user to select a condition or set of conditions which will cause the device to switch to a mode using less power. For example, a device might provide a scale of durations that must elapse without user interaction before it goes to sleep.

      MatterSpecification.v13.Cluster § 9.5.4.2

  • Readonlyid: 155
  • Readonlyname: "EnergyPreference"
  • Readonlyrevision: 1
defaults: ClusterState.Type<Of<{
    extensions: readonly [{
        component: {
            attributes: {
                currentEnergyBalance: WritableAttribute<number, any>;
                energyBalances: FixedAttribute<TypeFromFields<{
                    label: ...;
                    step: ...;
                }>[], any>;
                energyPriorities: FixedAttribute<EnergyPreference.EnergyPriority[], any>;
            };
        };
        flags: {
            energyBalance: true;
        };
    }, {
        component: {
            attributes: {
                currentLowPowerModeSensitivity: WritableAttribute<number, any>;
                lowPowerModeSensitivities: FixedAttribute<TypeFromFields<{
                    label: ...;
                    step: ...;
                }>[], any>;
            };
        };
        flags: {
            lowPowerModeSensitivity: true;
        };
    }, {
        component: false;
        flags: {
            energyBalance: false;
            lowPowerModeSensitivity: false;
        };
    }];
    features: {
        energyBalance: BitFlag;
        lowPowerModeSensitivity: BitFlag;
    };
    id: 155;
    name: "EnergyPreference";
    revision: 1;
}>, typeof ClusterBehavior>
dependencies?: Iterable<Type, any, any>
early: boolean
Events: ClusterEvents.Type<Of<{
    extensions: readonly [{
        component: {
            attributes: {
                currentEnergyBalance: WritableAttribute<number, any>;
                energyBalances: FixedAttribute<TypeFromFields<{
                    label: ...;
                    step: ...;
                }>[], any>;
                energyPriorities: FixedAttribute<EnergyPreference.EnergyPriority[], any>;
            };
        };
        flags: {
            energyBalance: true;
        };
    }, {
        component: {
            attributes: {
                currentLowPowerModeSensitivity: WritableAttribute<number, any>;
                lowPowerModeSensitivities: FixedAttribute<TypeFromFields<{
                    label: ...;
                    step: ...;
                }>[], any>;
            };
        };
        flags: {
            lowPowerModeSensitivity: true;
        };
    }, {
        component: false;
        flags: {
            energyBalance: false;
            lowPowerModeSensitivity: false;
        };
    }];
    features: {
        energyBalance: BitFlag;
        lowPowerModeSensitivity: BitFlag;
    };
    id: 155;
    name: "EnergyPreference";
    revision: 1;
}>, 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<Of<{
    extensions: readonly [{
        component: {
            attributes: {
                currentEnergyBalance: WritableAttribute<number, any>;
                energyBalances: FixedAttribute<TypeFromFields<(...)>[], any>;
                energyPriorities: FixedAttribute<EnergyPreference.EnergyPriority[], any>;
            };
        };
        flags: {
            energyBalance: true;
        };
    }, {
        component: {
            attributes: {
                currentLowPowerModeSensitivity: WritableAttribute<number, any>;
                lowPowerModeSensitivities: FixedAttribute<TypeFromFields<(...)>[], any>;
            };
        };
        flags: {
            lowPowerModeSensitivity: true;
        };
    }, {
        component: false;
        flags: {
            energyBalance: false;
            lowPowerModeSensitivity: false;
        };
    }];
    features: {
        energyBalance: BitFlag;
        lowPowerModeSensitivity: BitFlag;
    };
    id: 155;
    name: "EnergyPreference";
    revision: 1;
}>, 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