This defines conformance for the Generic Switch device type.

GenericSwitchDevice requires Switch cluster but Switch is not added by default because you must select the features your device supports. You can add manually using GenericSwitchDevice.with().

MatterSpecification.v13.Device § 6.6

interface GenericSwitchDevice {
    behaviors: {
        identify: typeof IdentifyServer;
    } & {
        identify: typeof IdentifyServer;
    };
    defaults: StateOf<{
        identify: typeof IdentifyServer;
    }>;
    deviceClass: DeviceClassification;
    deviceRevision: number;
    deviceType: DeviceTypeId;
    name: "GenericSwitch";
    requirements: typeof GenericSwitchRequirements;
    set(defaults: InputStateOf<{
        identify: typeof IdentifyServer;
    }>): With<For<{
        behaviors: {
            identify: typeof IdentifyServer;
        };
        deviceRevision: 3;
        deviceType: 15;
        name: "GenericSwitch";
        requirements: typeof GenericSwitchRequirements;
    }>, {
        identify: typeof IdentifyServer;
    }>;
    with<const BL>(...behaviors: BL): With<For<{
        behaviors: {
            identify: typeof IdentifyServer;
        };
        deviceRevision: 3;
        deviceType: 15;
        name: "GenericSwitch";
        requirements: typeof GenericSwitchRequirements;
    }>, With<{
        identify: typeof IdentifyServer;
    }, BL>>;
}

Hierarchy (view full)

Properties

behaviors: {
    identify: typeof IdentifyServer;
} & {
    identify: typeof IdentifyServer;
}
defaults: StateOf<{
    identify: typeof IdentifyServer;
}>

Access default state values.

deviceRevision: number
deviceType: DeviceTypeId
name
requirements: typeof GenericSwitchRequirements

Methods

  • Define an endpoint like this one with different defaults. Only updates values present in the input object.

    Parameters

    • defaults: InputStateOf<{
          identify: typeof IdentifyServer;
      }>

    Returns With<For<{
        behaviors: {
            identify: typeof IdentifyServer;
        };
        deviceRevision: 3;
        deviceType: 15;
        name: "GenericSwitch";
        requirements: typeof GenericSwitchRequirements;
    }>, {
        identify: typeof IdentifyServer;
    }>

  • Define an endpoint like this one with additional and/or replacement server behaviors.

    Type Parameters

    • const BL extends List

    Parameters

    • Rest...behaviors: BL

    Returns With<For<{
        behaviors: {
            identify: typeof IdentifyServer;
        };
        deviceRevision: 3;
        deviceType: 15;
        name: "GenericSwitch";
        requirements: typeof GenericSwitchRequirements;
    }>, With<{
        identify: typeof IdentifyServer;
    }, BL>>