interface ElectricalEnergyMeasurementBehavior {
    [reference]: Datasource<StateType>;
    agent: Agent;
    cluster: never;
    context: ActionContext;
    endpoint: Endpoint<Empty>;
    env: Environment;
    events: EventEmitter & Omit<Events, never> & {
        accuracy$Changing: ClusterEvents.AttributeObservable<FixedAttribute<TypeFromFields<{
            accuracyRanges: FieldType<TypeFromFields<{
                fixedMax: OptionalFieldType<(...)>;
                fixedMin: OptionalFieldType<(...)>;
                fixedTypical: OptionalFieldType<(...)>;
                percentMax: OptionalFieldType<(...)>;
                percentMin: OptionalFieldType<(...)>;
                percentTypical: OptionalFieldType<(...)>;
                rangeMax: FieldType<(...)>;
                rangeMin: FieldType<(...)>;
            }>[]>;
            maxMeasuredValue: FieldType<number | bigint>;
            measured: FieldType<boolean>;
            measurementType: FieldType<MeasurementType>;
            minMeasuredValue: FieldType<number | bigint>;
        }>, any>>;
    } & {} & {
        accuracy$Changed: ClusterEvents.AttributeObservable<FixedAttribute<TypeFromFields<{
            accuracyRanges: FieldType<TypeFromFields<{
                fixedMax: OptionalFieldType<(...)>;
                fixedMin: OptionalFieldType<(...)>;
                fixedTypical: OptionalFieldType<(...)>;
                percentMax: OptionalFieldType<(...)>;
                percentMin: OptionalFieldType<(...)>;
                percentTypical: OptionalFieldType<(...)>;
                rangeMax: FieldType<(...)>;
                rangeMin: FieldType<(...)>;
            }>[]>;
            maxMeasuredValue: FieldType<number | bigint>;
            measured: FieldType<boolean>;
            measurementType: FieldType<MeasurementType>;
            minMeasuredValue: FieldType<number | bigint>;
        }>, any>>;
    } & {} & {} & {};
    features: TypeFromBitSchema<{
        cumulativeEnergy: BitFlag;
        exportedEnergy: BitFlag;
        importedEnergy: BitFlag;
        periodicEnergy: BitFlag;
    }>;
    session: SecureSession;
    state: Omit<{}, never> & {} & {} & {
        accuracy: TypeFromFields<{
            accuracyRanges: FieldType<TypeFromFields<{
                fixedMax: OptionalFieldType<number | bigint>;
                fixedMin: OptionalFieldType<number | bigint>;
                fixedTypical: OptionalFieldType<number | bigint>;
                percentMax: OptionalFieldType<number>;
                percentMin: OptionalFieldType<number>;
                percentTypical: OptionalFieldType<number>;
                rangeMax: FieldType<number | bigint>;
                rangeMin: FieldType<number | bigint>;
            }>[]>;
            maxMeasuredValue: FieldType<number | bigint>;
            measured: FieldType<boolean>;
            measurementType: FieldType<MeasurementType>;
            minMeasuredValue: FieldType<number | bigint>;
        }>;
    } & {};
    [asyncDispose](): MaybePromise;
    asAdmin(fn: (() => void)): void;
    assertAttributeEnabled<This, K>(this: This, attributeName: K): void;
    callback<A, R>(reactor: Reactor<A, R>, options?: Reactor.Options): ((...args: A) => undefined | R);
    initialize(_options?: {}): MaybePromise;
    reactTo<O>(observable: O, reactor: Reactor<Parameters<O["emit"]>, ReturnType<O["emit"]>>, options?: Reactor.Options): void;
    requireAttributeEnabled<This, K>(this: This, attributeName: K): Exclude<This["state"][K], undefined>;
    toString(): string;
    State: any;
}

Hierarchy

  • ElectricalEnergyMeasurementBehaviorType
    • ElectricalEnergyMeasurementBehavior

Properties

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

The implemented cluster.

context: ActionContext
endpoint: Endpoint<Empty>
events: EventEmitter & Omit<Events, never> & {
    accuracy$Changing: ClusterEvents.AttributeObservable<FixedAttribute<TypeFromFields<{
        accuracyRanges: FieldType<TypeFromFields<{
            fixedMax: OptionalFieldType<(...)>;
            fixedMin: OptionalFieldType<(...)>;
            fixedTypical: OptionalFieldType<(...)>;
            percentMax: OptionalFieldType<(...)>;
            percentMin: OptionalFieldType<(...)>;
            percentTypical: OptionalFieldType<(...)>;
            rangeMax: FieldType<(...)>;
            rangeMin: FieldType<(...)>;
        }>[]>;
        maxMeasuredValue: FieldType<number | bigint>;
        measured: FieldType<boolean>;
        measurementType: FieldType<MeasurementType>;
        minMeasuredValue: FieldType<number | bigint>;
    }>, any>>;
} & {} & {
    accuracy$Changed: ClusterEvents.AttributeObservable<FixedAttribute<TypeFromFields<{
        accuracyRanges: FieldType<TypeFromFields<{
            fixedMax: OptionalFieldType<(...)>;
            fixedMin: OptionalFieldType<(...)>;
            fixedTypical: OptionalFieldType<(...)>;
            percentMax: OptionalFieldType<(...)>;
            percentMin: OptionalFieldType<(...)>;
            percentTypical: OptionalFieldType<(...)>;
            rangeMax: FieldType<(...)>;
            rangeMin: FieldType<(...)>;
        }>[]>;
        maxMeasuredValue: FieldType<number | bigint>;
        measured: FieldType<boolean>;
        measurementType: FieldType<MeasurementType>;
        minMeasuredValue: FieldType<number | bigint>;
    }>, any>>;
} & {} & {} & {}

Access the behavior's events.

features: TypeFromBitSchema<{
    cumulativeEnergy: BitFlag;
    exportedEnergy: BitFlag;
    importedEnergy: BitFlag;
    periodicEnergy: BitFlag;
}>

Supported features as a flag object.

Type declaration

  • ReadonlycumulativeEnergy: BitFlag

    CumulativeEnergy

    The feature indicates the server is capable of measuring how much energy has been imported or exported by the server over the device’s lifetime. This measurement may start from when a device’s firmware is updated to include this feature, when a device’s firmware is updated to correct measurement errors, or when a device is factory reset.

    MatterSpecification.v13.Cluster § 2.12.4.3

  • ReadonlyexportedEnergy: BitFlag

    ExportedEnergy

    The feature indicates the server is capable of measuring how much energy is exported by the server.

    MatterSpecification.v13.Cluster § 2.12.4.2

  • ReadonlyimportedEnergy: BitFlag

    ImportedEnergy

    The feature indicates the server is capable of measuring how much energy is imported by the server.

    MatterSpecification.v13.Cluster § 2.12.4.1

  • ReadonlyperiodicEnergy: BitFlag

    PeriodicEnergy

    The feature indicates the server is capable of measuring how much energy has been imported or exported by the server during a certain period of time. The start and end times for measurement periods shall be determined by the server, and may represent overlapping periods.

    MatterSpecification.v13.Cluster § 2.12.4.4

session: SecureSession
state: Omit<{}, never> & {} & {} & {
    accuracy: TypeFromFields<{
        accuracyRanges: FieldType<TypeFromFields<{
            fixedMax: OptionalFieldType<number | bigint>;
            fixedMin: OptionalFieldType<number | bigint>;
            fixedTypical: OptionalFieldType<number | bigint>;
            percentMax: OptionalFieldType<number>;
            percentMin: OptionalFieldType<number>;
            percentTypical: OptionalFieldType<number>;
            rangeMax: FieldType<number | bigint>;
            rangeMin: FieldType<number | bigint>;
        }>[]>;
        maxMeasuredValue: FieldType<number | bigint>;
        measured: FieldType<boolean>;
        measurementType: FieldType<MeasurementType>;
        minMeasuredValue: FieldType<number | bigint>;
    }>;
} & {}

Access the behavior's state.

Type declaration

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

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

    Parameters

    • Optional_options: {}

      Returns MaybePromise

    • Install a Reactor.

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

      Type Parameters

      Parameters

      Returns void