This is the default server implementation of SmokeCoAlarmBehavior.

The Matter specification requires the SmokeCoAlarm cluster to support features we do not enable by default. You should use SmokeCoAlarmServer.with to specialize the class for the features your implementation supports.

Hierarchy (view full)

Constructors

  • Parameters

    • agent: Agent
    • backing: BehaviorBacking

    Returns SmokeCoAlarmServer

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.

cluster: Of<{
    attributes: {
        batteryAlert: Attribute<SmokeCoAlarm.AlarmState, any>;
        deviceMuted: OptionalAttribute<SmokeCoAlarm.MuteState, any>;
        endOfServiceAlert: Attribute<SmokeCoAlarm.EndOfService, any>;
        expiryDate: OptionalFixedAttribute<number, any>;
        expressedState: Attribute<SmokeCoAlarm.ExpressedState, any>;
        hardwareFaultAlert: Attribute<boolean, any>;
        interconnectCoAlarm: OptionalAttribute<SmokeCoAlarm.AlarmState, any>;
        interconnectSmokeAlarm: OptionalAttribute<SmokeCoAlarm.AlarmState, any>;
        testInProgress: Attribute<boolean, any>;
    };
    commands: {
        selfTestRequest: OptionalCommand<void, void, any>;
    };
    events: {
        alarmMuted: OptionalEvent<void, any>;
        allClear: Event<void, any>;
        endOfService: Event<void, any>;
        hardwareFault: Event<void, any>;
        lowBattery: Event<TypeFromFields<{
            alarmSeverityLevel: FieldType<SmokeCoAlarm.AlarmState>;
        }>, any>;
        muteEnded: OptionalEvent<void, any>;
        selfTestComplete: Event<void, any>;
    };
    extensions: readonly [{
        component: {
            attributes: {
                contaminationState: OptionalAttribute<SmokeCoAlarm.ContaminationState, any>;
                smokeSensitivityLevel: OptionalWritableAttribute<SmokeCoAlarm.Sensitivity, any>;
                smokeState: Attribute<SmokeCoAlarm.AlarmState, any>;
            };
            events: {
                interconnectSmokeAlarm: OptionalEvent<TypeFromFields<{
                    alarmSeverityLevel: FieldType<SmokeCoAlarm.AlarmState>;
                }>, any>;
                smokeAlarm: Event<TypeFromFields<{
                    alarmSeverityLevel: FieldType<SmokeCoAlarm.AlarmState>;
                }>, any>;
            };
        };
        flags: {
            smokeAlarm: true;
        };
    }, {
        component: {
            attributes: {
                coState: Attribute<SmokeCoAlarm.AlarmState, any>;
            };
            events: {
                coAlarm: Event<TypeFromFields<{
                    alarmSeverityLevel: FieldType<SmokeCoAlarm.AlarmState>;
                }>, any>;
                interconnectCoAlarm: OptionalEvent<TypeFromFields<{
                    alarmSeverityLevel: FieldType<SmokeCoAlarm.AlarmState>;
                }>, any>;
            };
        };
        flags: {
            coAlarm: true;
        };
    }, {
        component: false;
        flags: {
            coAlarm: false;
            smokeAlarm: false;
        };
    }];
    features: {
        coAlarm: BitFlag;
        smokeAlarm: BitFlag;
    };
    id: 92;
    name: "SmokeCoAlarm";
    revision: 1;
}>

Base cluster state include all attribute values but may be extended by subclasses.

defaults: ClusterState.Type<Of<{
    attributes: {
        batteryAlert: Attribute<SmokeCoAlarm.AlarmState, any>;
        deviceMuted: OptionalAttribute<SmokeCoAlarm.MuteState, any>;
        endOfServiceAlert: Attribute<SmokeCoAlarm.EndOfService, any>;
        expiryDate: OptionalFixedAttribute<number, any>;
        expressedState: Attribute<SmokeCoAlarm.ExpressedState, any>;
        hardwareFaultAlert: Attribute<boolean, any>;
        interconnectCoAlarm: OptionalAttribute<SmokeCoAlarm.AlarmState, any>;
        interconnectSmokeAlarm: OptionalAttribute<SmokeCoAlarm.AlarmState, any>;
        testInProgress: Attribute<boolean, any>;
    };
    commands: {
        selfTestRequest: OptionalCommand<void, void, any>;
    };
    events: {
        alarmMuted: OptionalEvent<void, any>;
        allClear: Event<void, any>;
        endOfService: Event<void, any>;
        hardwareFault: Event<void, any>;
        lowBattery: Event<TypeFromFields<{
            alarmSeverityLevel: FieldType<SmokeCoAlarm.AlarmState>;
        }>, any>;
        muteEnded: OptionalEvent<void, any>;
        selfTestComplete: Event<void, any>;
    };
    extensions: readonly [{
        component: {
            attributes: {
                contaminationState: OptionalAttribute<SmokeCoAlarm.ContaminationState, any>;
                smokeSensitivityLevel: OptionalWritableAttribute<SmokeCoAlarm.Sensitivity, any>;
                smokeState: Attribute<SmokeCoAlarm.AlarmState, any>;
            };
            events: {
                interconnectSmokeAlarm: OptionalEvent<TypeFromFields<{
                    alarmSeverityLevel: FieldType<(...)>;
                }>, any>;
                smokeAlarm: Event<TypeFromFields<{
                    alarmSeverityLevel: FieldType<(...)>;
                }>, any>;
            };
        };
        flags: {
            smokeAlarm: true;
        };
    }, {
        component: {
            attributes: {
                coState: Attribute<SmokeCoAlarm.AlarmState, any>;
            };
            events: {
                coAlarm: Event<TypeFromFields<{
                    alarmSeverityLevel: FieldType<(...)>;
                }>, any>;
                interconnectCoAlarm: OptionalEvent<TypeFromFields<{
                    alarmSeverityLevel: FieldType<(...)>;
                }>, any>;
            };
        };
        flags: {
            coAlarm: true;
        };
    }, {
        component: false;
        flags: {
            coAlarm: false;
            smokeAlarm: false;
        };
    }];
    features: {
        coAlarm: BitFlag;
        smokeAlarm: BitFlag;
    };
    id: 92;
    name: "SmokeCoAlarm";
    revision: 1;
}>, Type<Of<{
    attributes: {};
    commands: {};
    events: {};
    id: 0;
    name: "Unknown";
    revision: 0;
}>, typeof ClusterBehavior, SmokeCoAlarmInterface>>
dependencies?: Iterable<Type, any, any>
early: boolean
Events: ClusterEvents.Type<Of<{
    attributes: {
        batteryAlert: Attribute<SmokeCoAlarm.AlarmState, any>;
        deviceMuted: OptionalAttribute<SmokeCoAlarm.MuteState, any>;
        endOfServiceAlert: Attribute<SmokeCoAlarm.EndOfService, any>;
        expiryDate: OptionalFixedAttribute<number, any>;
        expressedState: Attribute<SmokeCoAlarm.ExpressedState, any>;
        hardwareFaultAlert: Attribute<boolean, any>;
        interconnectCoAlarm: OptionalAttribute<SmokeCoAlarm.AlarmState, any>;
        interconnectSmokeAlarm: OptionalAttribute<SmokeCoAlarm.AlarmState, any>;
        testInProgress: Attribute<boolean, any>;
    };
    commands: {
        selfTestRequest: OptionalCommand<void, void, any>;
    };
    events: {
        alarmMuted: OptionalEvent<void, any>;
        allClear: Event<void, any>;
        endOfService: Event<void, any>;
        hardwareFault: Event<void, any>;
        lowBattery: Event<TypeFromFields<{
            alarmSeverityLevel: FieldType<SmokeCoAlarm.AlarmState>;
        }>, any>;
        muteEnded: OptionalEvent<void, any>;
        selfTestComplete: Event<void, any>;
    };
    extensions: readonly [{
        component: {
            attributes: {
                contaminationState: OptionalAttribute<SmokeCoAlarm.ContaminationState, any>;
                smokeSensitivityLevel: OptionalWritableAttribute<SmokeCoAlarm.Sensitivity, any>;
                smokeState: Attribute<SmokeCoAlarm.AlarmState, any>;
            };
            events: {
                interconnectSmokeAlarm: OptionalEvent<TypeFromFields<{
                    alarmSeverityLevel: FieldType<(...)>;
                }>, any>;
                smokeAlarm: Event<TypeFromFields<{
                    alarmSeverityLevel: FieldType<(...)>;
                }>, any>;
            };
        };
        flags: {
            smokeAlarm: true;
        };
    }, {
        component: {
            attributes: {
                coState: Attribute<SmokeCoAlarm.AlarmState, any>;
            };
            events: {
                coAlarm: Event<TypeFromFields<{
                    alarmSeverityLevel: FieldType<(...)>;
                }>, any>;
                interconnectCoAlarm: OptionalEvent<TypeFromFields<{
                    alarmSeverityLevel: FieldType<(...)>;
                }>, any>;
            };
        };
        flags: {
            coAlarm: true;
        };
    }, {
        component: false;
        flags: {
            coAlarm: false;
            smokeAlarm: false;
        };
    }];
    features: {
        coAlarm: BitFlag;
        smokeAlarm: BitFlag;
    };
    id: 92;
    name: "SmokeCoAlarm";
    revision: 1;
}>, Type<Of<{
    attributes: {};
    commands: {};
    events: {};
    id: 0;
    name: "Unknown";
    revision: 0;
}>, typeof ClusterBehavior, SmokeCoAlarmInterface>>
ExtensionInterface: {}
id

The behavior ID for ClusterBehaviors is the name of the cluster.

Internal: (new () => {})

Type declaration

    • new (): {}
    • Implementation of internal state. Subclasses may override to extend.

      Returns {}

    name: string
    schema?: Schema
    State: (new () => ClusterState.Type<Of<{
        attributes: {
            batteryAlert: Attribute<SmokeCoAlarm.AlarmState, any>;
            deviceMuted: OptionalAttribute<SmokeCoAlarm.MuteState, any>;
            endOfServiceAlert: Attribute<SmokeCoAlarm.EndOfService, any>;
            expiryDate: OptionalFixedAttribute<number, any>;
            expressedState: Attribute<SmokeCoAlarm.ExpressedState, any>;
            hardwareFaultAlert: Attribute<boolean, any>;
            interconnectCoAlarm: OptionalAttribute<SmokeCoAlarm.AlarmState, any>;
            interconnectSmokeAlarm: OptionalAttribute<SmokeCoAlarm.AlarmState, any>;
            testInProgress: Attribute<boolean, any>;
        };
        commands: {
            selfTestRequest: OptionalCommand<void, void, any>;
        };
        events: {
            alarmMuted: OptionalEvent<void, any>;
            allClear: Event<void, any>;
            endOfService: Event<void, any>;
            hardwareFault: Event<void, any>;
            lowBattery: Event<TypeFromFields<{
                alarmSeverityLevel: FieldType<SmokeCoAlarm.AlarmState>;
            }>, any>;
            muteEnded: OptionalEvent<void, any>;
            selfTestComplete: Event<void, any>;
        };
        extensions: readonly [{
            component: {
                attributes: {
                    contaminationState: OptionalAttribute<SmokeCoAlarm.ContaminationState, any>;
                    smokeSensitivityLevel: OptionalWritableAttribute<SmokeCoAlarm.Sensitivity, any>;
                    smokeState: Attribute<SmokeCoAlarm.AlarmState, any>;
                };
                events: {
                    interconnectSmokeAlarm: OptionalEvent<TypeFromFields<{
                        alarmSeverityLevel: ...;
                    }>, any>;
                    smokeAlarm: Event<TypeFromFields<{
                        alarmSeverityLevel: ...;
                    }>, any>;
                };
            };
            flags: {
                smokeAlarm: true;
            };
        }, {
            component: {
                attributes: {
                    coState: Attribute<SmokeCoAlarm.AlarmState, any>;
                };
                events: {
                    coAlarm: Event<TypeFromFields<{
                        alarmSeverityLevel: ...;
                    }>, any>;
                    interconnectCoAlarm: OptionalEvent<TypeFromFields<{
                        alarmSeverityLevel: ...;
                    }>, any>;
                };
            };
            flags: {
                coAlarm: true;
            };
        }, {
            component: false;
            flags: {
                coAlarm: false;
                smokeAlarm: false;
            };
        }];
        features: {
            coAlarm: BitFlag;
            smokeAlarm: BitFlag;
        };
        id: 92;
        name: "SmokeCoAlarm";
        revision: 1;
    }>, Type<Of<{
        attributes: {};
        commands: {};
        events: {};
        id: 0;
        name: "Unknown";
        revision: 0;
    }>, typeof ClusterBehavior, SmokeCoAlarmInterface>>)
    supervisor: RootSupervisor
    supports: ((other: Type) => boolean)

    Type declaration

      • (other): boolean
      • Does this behavior support functionality of a specific implementation?

        Parameters

        Returns boolean

    Methods

    • 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

      • Type Parameters

        Parameters

        Returns This