interface SmokeCoAlarmBehavior {
    [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> & {
        batteryAlert$Changing: ClusterEvents.AttributeObservable<Attribute<SmokeCoAlarm.AlarmState, any>>;
        endOfServiceAlert$Changing: ClusterEvents.AttributeObservable<Attribute<SmokeCoAlarm.EndOfService, any>>;
        expressedState$Changing: ClusterEvents.AttributeObservable<Attribute<SmokeCoAlarm.ExpressedState, any>>;
        hardwareFaultAlert$Changing: ClusterEvents.AttributeObservable<Attribute<boolean, any>>;
        testInProgress$Changing: ClusterEvents.AttributeObservable<Attribute<boolean, any>>;
    } & {
        deviceMuted$Changing: undefined | ClusterEvents.AttributeObservable<OptionalAttribute<SmokeCoAlarm.MuteState, any>>;
        expiryDate$Changing: undefined | ClusterEvents.AttributeObservable<OptionalFixedAttribute<number, any>>;
        interconnectCoAlarm$Changing: undefined | ClusterEvents.AttributeObservable<OptionalAttribute<SmokeCoAlarm.AlarmState, any>>;
        interconnectSmokeAlarm$Changing: undefined | ClusterEvents.AttributeObservable<OptionalAttribute<SmokeCoAlarm.AlarmState, any>>;
    } & {
        batteryAlert$Changed: ClusterEvents.AttributeObservable<Attribute<SmokeCoAlarm.AlarmState, any>>;
        endOfServiceAlert$Changed: ClusterEvents.AttributeObservable<Attribute<SmokeCoAlarm.EndOfService, any>>;
        expressedState$Changed: ClusterEvents.AttributeObservable<Attribute<SmokeCoAlarm.ExpressedState, any>>;
        hardwareFaultAlert$Changed: ClusterEvents.AttributeObservable<Attribute<boolean, any>>;
        testInProgress$Changed: ClusterEvents.AttributeObservable<Attribute<boolean, any>>;
    } & {
        deviceMuted$Changed: undefined | ClusterEvents.AttributeObservable<OptionalAttribute<SmokeCoAlarm.MuteState, any>>;
        expiryDate$Changed: undefined | ClusterEvents.AttributeObservable<OptionalFixedAttribute<number, any>>;
        interconnectCoAlarm$Changed: undefined | ClusterEvents.AttributeObservable<OptionalAttribute<SmokeCoAlarm.AlarmState, any>>;
        interconnectSmokeAlarm$Changed: undefined | ClusterEvents.AttributeObservable<OptionalAttribute<SmokeCoAlarm.AlarmState, any>>;
    } & {
        allClear: ClusterEvents.EventObservable<Event<void, any>>;
        endOfService: ClusterEvents.EventObservable<Event<void, any>>;
        hardwareFault: ClusterEvents.EventObservable<Event<void, any>>;
        lowBattery: ClusterEvents.EventObservable<Event<TypeFromFields<{
            alarmSeverityLevel: FieldType<SmokeCoAlarm.AlarmState>;
        }>, any>>;
        selfTestComplete: ClusterEvents.EventObservable<Event<void, any>>;
    } & {
        alarmMuted?: ClusterEvents.EventObservable<OptionalEvent<void, any>>;
        muteEnded?: ClusterEvents.EventObservable<OptionalEvent<void, any>>;
    };
    features: TypeFromBitSchema<{}> & TypeFromBitSchema<{
        coAlarm: BitFlag;
        smokeAlarm: BitFlag;
    }>;
    session: SecureSession;
    state: Omit<ClusterState.Type<Of<{
        attributes: {};
        commands: {};
        events: {};
        id: 0;
        name: "Unknown";
        revision: 0;
    }>, typeof ClusterBehavior>, never> & {
        batteryAlert: SmokeCoAlarm.AlarmState;
        endOfServiceAlert: SmokeCoAlarm.EndOfService;
        expressedState: SmokeCoAlarm.ExpressedState;
        hardwareFaultAlert: boolean;
        testInProgress: boolean;
    } & {
        deviceMuted?: SmokeCoAlarm.MuteState;
        interconnectCoAlarm?: SmokeCoAlarm.AlarmState;
        interconnectSmokeAlarm?: SmokeCoAlarm.AlarmState;
    } & {} & {
        expiryDate?: 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>;
    selfTestRequest(): MaybePromise;
    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> & {
    batteryAlert$Changing: ClusterEvents.AttributeObservable<Attribute<SmokeCoAlarm.AlarmState, any>>;
    endOfServiceAlert$Changing: ClusterEvents.AttributeObservable<Attribute<SmokeCoAlarm.EndOfService, any>>;
    expressedState$Changing: ClusterEvents.AttributeObservable<Attribute<SmokeCoAlarm.ExpressedState, any>>;
    hardwareFaultAlert$Changing: ClusterEvents.AttributeObservable<Attribute<boolean, any>>;
    testInProgress$Changing: ClusterEvents.AttributeObservable<Attribute<boolean, any>>;
} & {
    deviceMuted$Changing: undefined | ClusterEvents.AttributeObservable<OptionalAttribute<SmokeCoAlarm.MuteState, any>>;
    expiryDate$Changing: undefined | ClusterEvents.AttributeObservable<OptionalFixedAttribute<number, any>>;
    interconnectCoAlarm$Changing: undefined | ClusterEvents.AttributeObservable<OptionalAttribute<SmokeCoAlarm.AlarmState, any>>;
    interconnectSmokeAlarm$Changing: undefined | ClusterEvents.AttributeObservable<OptionalAttribute<SmokeCoAlarm.AlarmState, any>>;
} & {
    batteryAlert$Changed: ClusterEvents.AttributeObservable<Attribute<SmokeCoAlarm.AlarmState, any>>;
    endOfServiceAlert$Changed: ClusterEvents.AttributeObservable<Attribute<SmokeCoAlarm.EndOfService, any>>;
    expressedState$Changed: ClusterEvents.AttributeObservable<Attribute<SmokeCoAlarm.ExpressedState, any>>;
    hardwareFaultAlert$Changed: ClusterEvents.AttributeObservable<Attribute<boolean, any>>;
    testInProgress$Changed: ClusterEvents.AttributeObservable<Attribute<boolean, any>>;
} & {
    deviceMuted$Changed: undefined | ClusterEvents.AttributeObservable<OptionalAttribute<SmokeCoAlarm.MuteState, any>>;
    expiryDate$Changed: undefined | ClusterEvents.AttributeObservable<OptionalFixedAttribute<number, any>>;
    interconnectCoAlarm$Changed: undefined | ClusterEvents.AttributeObservable<OptionalAttribute<SmokeCoAlarm.AlarmState, any>>;
    interconnectSmokeAlarm$Changed: undefined | ClusterEvents.AttributeObservable<OptionalAttribute<SmokeCoAlarm.AlarmState, any>>;
} & {
    allClear: ClusterEvents.EventObservable<Event<void, any>>;
    endOfService: ClusterEvents.EventObservable<Event<void, any>>;
    hardwareFault: ClusterEvents.EventObservable<Event<void, any>>;
    lowBattery: ClusterEvents.EventObservable<Event<TypeFromFields<{
        alarmSeverityLevel: FieldType<SmokeCoAlarm.AlarmState>;
    }>, any>>;
    selfTestComplete: ClusterEvents.EventObservable<Event<void, any>>;
} & {
    alarmMuted?: ClusterEvents.EventObservable<OptionalEvent<void, any>>;
    muteEnded?: ClusterEvents.EventObservable<OptionalEvent<void, any>>;
}

Access the behavior's events.

features: TypeFromBitSchema<{}> & TypeFromBitSchema<{
    coAlarm: BitFlag;
    smokeAlarm: 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> & {
    batteryAlert: SmokeCoAlarm.AlarmState;
    endOfServiceAlert: SmokeCoAlarm.EndOfService;
    expressedState: SmokeCoAlarm.ExpressedState;
    hardwareFaultAlert: boolean;
    testInProgress: boolean;
} & {
    deviceMuted?: SmokeCoAlarm.MuteState;
    interconnectCoAlarm?: SmokeCoAlarm.AlarmState;
    interconnectSmokeAlarm?: SmokeCoAlarm.AlarmState;
} & {} & {
    expiryDate?: number;
}

Access the behavior's state.

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>

    • This command shall initiate a device self-test. The return status shall indicate whether the test was successfully initiated. Only one SelfTestRequest may be processed at a time. When the value of the ExpressedState attribute is any of SmokeAlarm, COAlarm, Testing, InterconnectSmoke, Inter

      connectCO, the device shall NOT execute the self-test, and shall return status code BUSY.

      Upon successful acceptance of SelfTestRequest, the TestInProgress attribute shall be set to True and ExpressedState attribute shall be set to Testing. Any faults identified during the test shall be reflected in the appropriate attributes and events. Upon completion of the self test procedure, the SelfTestComplete event shall be generated, the TestInProgress attribute shall be set to False and ExpressedState attribute shall be updated to reflect the current state of the server.

      Returns MaybePromise

      MatterSpecification.v13.Cluster § 2.11.7.1

    • Description used in diagnostic messages.

      Returns string