interface IcdManagementBehavior {
    [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> & {
        activeModeDuration$Changing: ClusterEvents.AttributeObservable<FixedAttribute<number, any>>;
        activeModeThreshold$Changing: ClusterEvents.AttributeObservable<FixedAttribute<number, any>>;
        idleModeDuration$Changing: ClusterEvents.AttributeObservable<FixedAttribute<number, any>>;
    } & {
        userActiveModeTriggerInstruction$Changing: undefined | ClusterEvents.AttributeObservable<OptionalFixedAttribute<string, any>>;
    } & {
        activeModeDuration$Changed: ClusterEvents.AttributeObservable<FixedAttribute<number, any>>;
        activeModeThreshold$Changed: ClusterEvents.AttributeObservable<FixedAttribute<number, any>>;
        idleModeDuration$Changed: ClusterEvents.AttributeObservable<FixedAttribute<number, any>>;
    } & {
        userActiveModeTriggerInstruction$Changed: undefined | ClusterEvents.AttributeObservable<OptionalFixedAttribute<string, any>>;
    } & {} & {};
    features: TypeFromBitSchema<{}> & TypeFromBitSchema<{
        checkInProtocolSupport: BitFlag;
        longIdleTimeSupport: BitFlag;
        userActiveModeTrigger: BitFlag;
    }>;
    session: SecureSession;
    state: Omit<ClusterState.Type<Of<{
        attributes: {};
        commands: {};
        events: {};
        id: 0;
        name: "Unknown";
        revision: 0;
    }>, typeof ClusterBehavior>, never> & {} & {} & {
        activeModeDuration: number;
        activeModeThreshold: number;
        idleModeDuration: number;
    } & {
        userActiveModeTriggerInstruction?: string;
    };
    [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>;
    stayActiveRequest(request: IcdManagement.StayActiveRequest): MaybePromise<IcdManagement.StayActiveResponse>;
    toString(): string;
    State: any;
}

Hierarchy (view full)

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> & {
    activeModeDuration$Changing: ClusterEvents.AttributeObservable<FixedAttribute<number, any>>;
    activeModeThreshold$Changing: ClusterEvents.AttributeObservable<FixedAttribute<number, any>>;
    idleModeDuration$Changing: ClusterEvents.AttributeObservable<FixedAttribute<number, any>>;
} & {
    userActiveModeTriggerInstruction$Changing: undefined | ClusterEvents.AttributeObservable<OptionalFixedAttribute<string, any>>;
} & {
    activeModeDuration$Changed: ClusterEvents.AttributeObservable<FixedAttribute<number, any>>;
    activeModeThreshold$Changed: ClusterEvents.AttributeObservable<FixedAttribute<number, any>>;
    idleModeDuration$Changed: ClusterEvents.AttributeObservable<FixedAttribute<number, any>>;
} & {
    userActiveModeTriggerInstruction$Changed: undefined | ClusterEvents.AttributeObservable<OptionalFixedAttribute<string, any>>;
} & {} & {}

Access the behavior's events.

features: TypeFromBitSchema<{}> & TypeFromBitSchema<{
    checkInProtocolSupport: BitFlag;
    longIdleTimeSupport: BitFlag;
    userActiveModeTrigger: 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> & {} & {} & {
    activeModeDuration: number;
    activeModeThreshold: number;
    idleModeDuration: number;
} & {
    userActiveModeTriggerInstruction?: string;
}

Access the behavior's state.

Type declaration

  • ReadonlyactiveModeDuration: number

    Indicates the minimum interval in milliseconds the server typically will stay in active mode after initial transition out of idle mode. The ActiveModeDuration does not include the ActiveModeThreshold.

    MatterSpecification.v13.Core § 9.17.6.2

  • ReadonlyactiveModeThreshold: number

    Indicates the minimum amount of time in milliseconds the server typically will stay active after network activity when in active mode.

    MatterSpecification.v13.Core § 9.17.6.3

  • ReadonlyidleModeDuration: number

    Indicates the maximum interval in seconds the server can stay in idle mode. The IdleModeDuration shall NOT be smaller than the ActiveModeDuration.

    MatterSpecification.v13.Core § 9.17.6.1

Type declaration

  • Optional ReadonlyuserActiveModeTriggerInstruction?: string

    The meaning of the attribute is dependent upon the UserActiveModeTriggerHint attribute value, and the conformance is in indicated in the "dependency" column in UserActiveModeTriggerHint table. The UserActiveModeTriggerInstruction attribute may give additional information on how to transition the device to Active Mode. If the attribute is present, the value shall be encoded as a valid UTF-8 string with a maximum length of 128 bytes. If the UserActiveModeTriggerHint has the ActuateSensorSeconds, ActuateSensorTimes, ResetButtonSeconds, ResetButtonTimes, SetupButtonSeconds or SetupButtonTimes set, the string shall consist solely of an encoding of N as a decimal

    unsigned integer using the ASCII digits 0-9, and without leading zeros.

    For example, given UserActiveModeTriggerHint="2048", ResetButtonTimes is set which indicates "Press Reset Button for N seconds". Therefore, a value of UserActiveModeTriggerInstruction="10" would indicate that N is 10 in that context.

    When CustomInstruction is set by the UserActiveModeTriggerHint attribute, indicating presence of a custom string, the ICD SHOULD perform localization (translation to user’s preferred language, as indicated in the Device’s currently configured locale). The Custom Instruction option SHOULD NOT be used by an ICD that does not have knowledge of the user’s language preference.

    ResetButtonLightsBlink or SetupButtonLightsBlink), information on color of light may be made available via the UserActiveModeTriggerInstruction attribute. When using such color indication in the UserActiveModeTriggerInstruction attribute, only basic primary and secondary colors that could unambiguously be decoded by a commissioner and understood by an end-user, but without worry of localization, SHOULD be used, e.g. white, red, green, blue, orange, yellow, purple. The length of the attribute SHOULD be kept small.

    MatterSpecification.v13.Core § 9.17.6.8

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