interface LevelControlBehavior {
    [reference]: Datasource<StateType>;
    agent: Agent;
    cluster: never;
    context: ActionContext;
    endpoint: Endpoint<Empty>;
    env: Environment;
    events: EventEmitter & Omit<ClusterEvents<Of<{
        attributes: {};
        commands: {};
        events: {};
        id: 0;
        name: "Unknown";
        revision: 0;
    }>, typeof ClusterBehavior>, never> & {
        currentLevel$Changing: ClusterEvents.AttributeObservable<Attribute<null | number, any>>;
        onLevel$Changing: ClusterEvents.AttributeObservable<WritableAttribute<null | number, any>>;
        options$Changing: ClusterEvents.AttributeObservable<WritableAttribute<TypeFromPartialBitSchema<{
            coupleColorTempToLevel: BitFlag;
            executeIfOff: BitFlag;
        }>, any>>;
    } & {
        defaultMoveRate$Changing: undefined | ClusterEvents.AttributeObservable<OptionalWritableAttribute<null | number, any>>;
        maxLevel$Changing: undefined | ClusterEvents.AttributeObservable<OptionalAttribute<number, any>>;
        minLevel$Changing: undefined | ClusterEvents.AttributeObservable<OptionalAttribute<number, any>>;
        offTransitionTime$Changing: undefined | ClusterEvents.AttributeObservable<OptionalWritableAttribute<null | number, any>>;
        onOffTransitionTime$Changing: undefined | ClusterEvents.AttributeObservable<OptionalWritableAttribute<number, any>>;
        onTransitionTime$Changing: undefined | ClusterEvents.AttributeObservable<OptionalWritableAttribute<null | number, any>>;
    } & {
        currentLevel$Changed: ClusterEvents.AttributeObservable<Attribute<null | number, any>>;
        onLevel$Changed: ClusterEvents.AttributeObservable<WritableAttribute<null | number, any>>;
        options$Changed: ClusterEvents.AttributeObservable<WritableAttribute<TypeFromPartialBitSchema<{
            coupleColorTempToLevel: BitFlag;
            executeIfOff: BitFlag;
        }>, any>>;
    } & {
        defaultMoveRate$Changed: undefined | ClusterEvents.AttributeObservable<OptionalWritableAttribute<null | number, any>>;
        maxLevel$Changed: undefined | ClusterEvents.AttributeObservable<OptionalAttribute<number, any>>;
        minLevel$Changed: undefined | ClusterEvents.AttributeObservable<OptionalAttribute<number, any>>;
        offTransitionTime$Changed: undefined | ClusterEvents.AttributeObservable<OptionalWritableAttribute<null | number, any>>;
        onOffTransitionTime$Changed: undefined | ClusterEvents.AttributeObservable<OptionalWritableAttribute<number, any>>;
        onTransitionTime$Changed: undefined | ClusterEvents.AttributeObservable<OptionalWritableAttribute<null | number, any>>;
    } & {} & {};
    features: TypeFromBitSchema<{}> & TypeFromBitSchema<{
        frequency: BitFlag;
        lighting: BitFlag;
        onOff: BitFlag;
    }>;
    session: SecureSession;
    state: Omit<ClusterState.Type<Of<{
        attributes: {};
        commands: {};
        events: {};
        id: 0;
        name: "Unknown";
        revision: 0;
    }>, typeof ClusterBehavior>, never> & {
        currentLevel: null | number;
        onLevel: null | number;
        options: TypeFromPartialBitSchema<{
            coupleColorTempToLevel: BitFlag;
            executeIfOff: BitFlag;
        }>;
    } & {
        defaultMoveRate?: null | number;
        maxLevel?: number;
        minLevel?: number;
        offTransitionTime?: null | number;
        onOffTransitionTime?: number;
        onTransitionTime?: null | 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;
    move(request: LevelControl.MoveRequest): MaybePromise;
    moveToLevel(request: LevelControl.MoveToLevelRequest): MaybePromise;
    moveToLevelWithOnOff(request: LevelControl.MoveToLevelRequest): MaybePromise;
    moveWithOnOff(request: LevelControl.MoveRequest): 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>;
    step(request: LevelControl.StepRequest): MaybePromise;
    stepWithOnOff(request: LevelControl.StepRequest): MaybePromise;
    stop(request: LevelControl.StopRequest): MaybePromise;
    stopWithOnOff(request: LevelControl.StopRequest): MaybePromise;
    toString(): string;
    State: any;
}

Hierarchy

  • LevelControlBehaviorType
    • LevelControlBehavior

Properties

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

The implemented cluster.

context: ActionContext
endpoint: Endpoint<Empty>
events: EventEmitter & Omit<ClusterEvents<Of<{
    attributes: {};
    commands: {};
    events: {};
    id: 0;
    name: "Unknown";
    revision: 0;
}>, typeof ClusterBehavior>, never> & {
    currentLevel$Changing: ClusterEvents.AttributeObservable<Attribute<null | number, any>>;
    onLevel$Changing: ClusterEvents.AttributeObservable<WritableAttribute<null | number, any>>;
    options$Changing: ClusterEvents.AttributeObservable<WritableAttribute<TypeFromPartialBitSchema<{
        coupleColorTempToLevel: BitFlag;
        executeIfOff: BitFlag;
    }>, any>>;
} & {
    defaultMoveRate$Changing: undefined | ClusterEvents.AttributeObservable<OptionalWritableAttribute<null | number, any>>;
    maxLevel$Changing: undefined | ClusterEvents.AttributeObservable<OptionalAttribute<number, any>>;
    minLevel$Changing: undefined | ClusterEvents.AttributeObservable<OptionalAttribute<number, any>>;
    offTransitionTime$Changing: undefined | ClusterEvents.AttributeObservable<OptionalWritableAttribute<null | number, any>>;
    onOffTransitionTime$Changing: undefined | ClusterEvents.AttributeObservable<OptionalWritableAttribute<number, any>>;
    onTransitionTime$Changing: undefined | ClusterEvents.AttributeObservable<OptionalWritableAttribute<null | number, any>>;
} & {
    currentLevel$Changed: ClusterEvents.AttributeObservable<Attribute<null | number, any>>;
    onLevel$Changed: ClusterEvents.AttributeObservable<WritableAttribute<null | number, any>>;
    options$Changed: ClusterEvents.AttributeObservable<WritableAttribute<TypeFromPartialBitSchema<{
        coupleColorTempToLevel: BitFlag;
        executeIfOff: BitFlag;
    }>, any>>;
} & {
    defaultMoveRate$Changed: undefined | ClusterEvents.AttributeObservable<OptionalWritableAttribute<null | number, any>>;
    maxLevel$Changed: undefined | ClusterEvents.AttributeObservable<OptionalAttribute<number, any>>;
    minLevel$Changed: undefined | ClusterEvents.AttributeObservable<OptionalAttribute<number, any>>;
    offTransitionTime$Changed: undefined | ClusterEvents.AttributeObservable<OptionalWritableAttribute<null | number, any>>;
    onOffTransitionTime$Changed: undefined | ClusterEvents.AttributeObservable<OptionalWritableAttribute<number, any>>;
    onTransitionTime$Changed: undefined | ClusterEvents.AttributeObservable<OptionalWritableAttribute<null | number, any>>;
} & {} & {}

Access the behavior's events.

features: TypeFromBitSchema<{}> & TypeFromBitSchema<{
    frequency: BitFlag;
    lighting: BitFlag;
    onOff: BitFlag;
}>

Supported features as a flag object.

session: SecureSession
state: Omit<ClusterState.Type<Of<{
    attributes: {};
    commands: {};
    events: {};
    id: 0;
    name: "Unknown";
    revision: 0;
}>, typeof ClusterBehavior>, never> & {
    currentLevel: null | number;
    onLevel: null | number;
    options: TypeFromPartialBitSchema<{
        coupleColorTempToLevel: BitFlag;
        executeIfOff: BitFlag;
    }>;
} & {
    defaultMoveRate?: null | number;
    maxLevel?: number;
    minLevel?: number;
    offTransitionTime?: null | number;
    onOffTransitionTime?: number;
    onTransitionTime?: null | number;
} & {} & {}

Access the behavior's state.

Type declaration

  • ReadonlycurrentLevel: null | number

    Indicates the current level of this device. The meaning of 'level' is device dependent.

    MatterSpecification.v13.Cluster § 1.6.6.2

  • ReadonlyonLevel: null | number

    Indicates the value that the CurrentLevel attribute is set to when the OnOff attribute of an On/Off cluster on the same endpoint is set to TRUE, as a result of processing an On/Off cluster command. If the OnLevel attribute is not implemented, or is set to the null value, it has no effect. For more details see Effect of On/Off Commands on the CurrentLevel Attribute.

    OnLevel represents a mandatory field that was previously not present or optional. Implementers should be aware that older devices may not implement it.

    MatterSpecification.v13.Cluster § 1.6.6.11

  • Readonlyoptions: TypeFromPartialBitSchema<{
        coupleColorTempToLevel: BitFlag;
        executeIfOff: BitFlag;
    }>

    Indicates the selected options of the device.

    The Options attribute is a bitmap that determines the default behavior of some cluster commands. Each command that is dependent on the Options attribute shall first construct a temporary Options bitmap that is in effect during the command processing. The temporary Options bitmap has the same format and meaning as the Options attribute, but includes any bits that may be overridden by command fields.

    This attribute is meant to be changed only during commissioning.

    Command execution shall NOT continue beyond the Options processing if all of these criteria are true:

    • The command is one of the ‘without On/Off’ commands: Move, Move to Level, Step, or Stop.

    • The On/Off cluster exists on the same endpoint as this cluster.

    • The OnOff attribute of the On/Off cluster, on this endpoint, is FALSE.

    • The value of the ExecuteIfOff bit is 0.

    MatterSpecification.v13.Cluster § 1.6.6.9

Type declaration

  • Optional ReadonlydefaultMoveRate?: null | number

    Indicates the movement rate, in units per second, when a Move command is received with a null value Rate parameter.

    MatterSpecification.v13.Cluster § 1.6.6.14

  • Optional ReadonlymaxLevel?: number

    Indicates the maximum value of CurrentLevel that is capable of being assigned.

    MatterSpecification.v13.Cluster § 1.6.6.5

  • Optional ReadonlyminLevel?: number

    Indicates the minimum value of CurrentLevel that is capable of being assigned.

    MatterSpecification.v13.Cluster § 1.6.6.4

  • Optional ReadonlyoffTransitionTime?: null | number

    Indicates the time taken to move the current level from the maximum level to the minimum level when an Off command is received by an On/Off cluster on the same endpoint. It is specified in 1/10ths of a second. If this attribute is not implemented, or contains a null value, the OnOffTransitionTime shall be used instead.

    MatterSpecification.v13.Cluster § 1.6.6.13

  • Optional ReadonlyonOffTransitionTime?: number

    Indicates the time taken to move to or from the target level when On or Off commands are received by an On/Off cluster on the same endpoint. It is specified in 1/10ths of a second.

    The actual time taken SHOULD be as close to OnOffTransitionTime as the device is able. Please note that if the device is not able to move at a variable rate, the OnOffTransitionTime attribute SHOULD NOT be implemented.

    MatterSpecification.v13.Cluster § 1.6.6.10

  • Optional ReadonlyonTransitionTime?: null | number

    Indicates the time taken to move the current level from the minimum level to the maximum level when an On command is received by an On/Off cluster on the same endpoint. It is specified in 1/10ths of a second. If this attribute is not implemented, or contains a null value, the OnOffTransitionTime shall be used instead.

    MatterSpecification.v13.Cluster § 1.6.6.12

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

    • Parameters

      Returns MaybePromise

      MatterSpecification.v13.Cluster § 1.6.7.2

    • Parameters

      Returns MaybePromise

      MatterSpecification.v13.Cluster § 1.6.7.1

    • Parameters

      Returns MaybePromise

      MatterSpecification.v13.Cluster § 1.6.7

    • Parameters

      Returns MaybePromise

      MatterSpecification.v13.Cluster § 1.6.7

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

    • Parameters

      Returns MaybePromise

      MatterSpecification.v13.Cluster § 1.6.7.3

    • Parameters

      Returns MaybePromise

      MatterSpecification.v13.Cluster § 1.6.7

    • Parameters

      Returns MaybePromise

      MatterSpecification.v13.Cluster § 1.6.7.4

    • Parameters

      Returns MaybePromise

      MatterSpecification.v13.Cluster § 1.6.7

    • Description used in diagnostic messages.

      Returns string