interface DeviceEnergyManagementModeBehavior {
    [reference]: Datasource<StateType>;
    agent: Agent;
    changeToMode: ClusterInterface.MethodForCommand<Command<TypeFromFields<{
        newMode: FieldType<number>;
    }>, void, any>>;
    cluster: never;
    context: ActionContext;
    endpoint: Endpoint<Empty>;
    env: Environment;
    events: EventEmitter & Omit<Events, never> & {
        currentMode$Changing: ClusterEvents.AttributeObservable<Attribute<number, any>>;
        supportedModes$Changing: ClusterEvents.AttributeObservable<FixedAttribute<TypeFromFields<{
            label: FieldType<string>;
            mode: FieldType<number>;
            modeTags: FieldType<TypeFromFields<{
                mfgCode: ...;
                value: ...;
            }>[]>;
        }>[], any>>;
    } & {
        startUpMode$Changing: undefined | ClusterEvents.AttributeObservable<OptionalWritableAttribute<null | number, any>>;
    } & {
        currentMode$Changed: ClusterEvents.AttributeObservable<Attribute<number, any>>;
        supportedModes$Changed: ClusterEvents.AttributeObservable<FixedAttribute<TypeFromFields<{
            label: FieldType<string>;
            mode: FieldType<number>;
            modeTags: FieldType<TypeFromFields<{
                mfgCode: ...;
                value: ...;
            }>[]>;
        }>[], any>>;
    } & {
        startUpMode$Changed: undefined | ClusterEvents.AttributeObservable<OptionalWritableAttribute<null | number, any>>;
    } & {} & {};
    features: TypeFromBitSchema<{
        onOff: BitFlag;
    }>;
    session: SecureSession;
    state: Omit<{}, never> & {
        currentMode: number;
    } & {
        startUpMode?: null | number;
    } & {
        supportedModes: TypeFromFields<{
            label: FieldType<string>;
            mode: FieldType<number>;
            modeTags: FieldType<TypeFromFields<{
                mfgCode: OptionalFieldType<VendorId>;
                value: FieldType<number>;
            }>[]>;
        }>[];
    } & {};
    [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 (view full)

Properties

[reference]: Datasource<StateType>
agent: Agent
changeToMode: ClusterInterface.MethodForCommand<Command<TypeFromFields<{
    newMode: FieldType<number>;
}>, void, any>>

This command is used to change device modes.

On receipt of this command the device shall respond with a ChangeToModeResponse command.

MatterSpecification.v13.Cluster § 1.10.7.1

cluster: never

The implemented cluster.

context: ActionContext
endpoint: Endpoint<Empty>
events: EventEmitter & Omit<Events, never> & {
    currentMode$Changing: ClusterEvents.AttributeObservable<Attribute<number, any>>;
    supportedModes$Changing: ClusterEvents.AttributeObservable<FixedAttribute<TypeFromFields<{
        label: FieldType<string>;
        mode: FieldType<number>;
        modeTags: FieldType<TypeFromFields<{
            mfgCode: ...;
            value: ...;
        }>[]>;
    }>[], any>>;
} & {
    startUpMode$Changing: undefined | ClusterEvents.AttributeObservable<OptionalWritableAttribute<null | number, any>>;
} & {
    currentMode$Changed: ClusterEvents.AttributeObservable<Attribute<number, any>>;
    supportedModes$Changed: ClusterEvents.AttributeObservable<FixedAttribute<TypeFromFields<{
        label: FieldType<string>;
        mode: FieldType<number>;
        modeTags: FieldType<TypeFromFields<{
            mfgCode: ...;
            value: ...;
        }>[]>;
    }>[], any>>;
} & {
    startUpMode$Changed: undefined | ClusterEvents.AttributeObservable<OptionalWritableAttribute<null | number, any>>;
} & {} & {}

Access the behavior's events.

features: TypeFromBitSchema<{
    onOff: BitFlag;
}>

Supported features as a flag object.

Type declaration

  • ReadonlyonOff: BitFlag

    OnOff

    This feature creates a dependency between an OnOff cluster instance and this cluster instance on the same endpoint. See OnMode for more information.

    MatterSpecification.v13.Cluster § 1.10.4.1

session: SecureSession
state: Omit<{}, never> & {
    currentMode: number;
} & {
    startUpMode?: null | number;
} & {
    supportedModes: TypeFromFields<{
        label: FieldType<string>;
        mode: FieldType<number>;
        modeTags: FieldType<TypeFromFields<{
            mfgCode: OptionalFieldType<VendorId>;
            value: FieldType<number>;
        }>[]>;
    }>[];
} & {}

Access the behavior's state.

Type declaration

  • ReadonlycurrentMode: number

    Indicates the current mode of the server.

    The value of this field shall match the Mode field of one of the entries in the SupportedModes attribute.

    The value of this attribute may change at any time via an out-of-band interaction outside of the server, such as interactions with a user interface, via internal mode changes due to autonomously progressing through a sequence of operations, on system time-outs or idle delays, or via interactions coming from a fabric other than the one which last executed a ChangeToMode.

    MatterSpecification.v13.Cluster § 1.10.6.3

Type declaration

  • Optional ReadonlystartUpMode?: null | number

    Indicates the desired startup mode for the server when it is supplied with power.

    If this attribute is not null, the CurrentMode attribute shall be set to the StartUpMode value, when the server is powered up, except in the case when the OnMode attribute overrides the StartUpMode attribute (see OnModeWithPowerUp).

    This behavior does not apply to reboots associated with OTA. After an OTA restart, the CurrentMode attribute shall return to its value prior to the restart.

    The value of this field shall match the Mode field of one of the entries in the SupportedModes attribute.

    If this attribute is not implemented, or is set to the null value, it shall have no effect.

    MatterSpecification.v13.Cluster § 1.10.6.4

Type declaration

  • ReadonlysupportedModes: TypeFromFields<{
        label: FieldType<string>;
        mode: FieldType<number>;
        modeTags: FieldType<TypeFromFields<{
            mfgCode: OptionalFieldType<VendorId>;
            value: FieldType<number>;
        }>[]>;
    }>[]

    This attribute shall contain the list of supported modes that may be selected for the CurrentMode attribute. Each item in this list represents a unique mode as indicated by the Mode field of the ModeOptionStruct.

    Each entry in this list shall have a unique value for the Mode field. Each entry in this list shall have a unique value for the Label field.

    MatterSpecification.v13.Cluster § 1.10.6.2

Methods

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

    Returns MaybePromise

  • 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

  • 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

    • 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