/** * @license * Copyright 2022-2026 Matter.js Authors * SPDX-License-Identifier: Apache-2.0 */ /*** THIS FILE IS GENERATED, DO NOT EDIT ***/ import { IdentifyServer as BaseIdentifyServer } from "../behaviors/identify/IdentifyServer.js"; import { GroupsServer as BaseGroupsServer } from "../behaviors/groups/GroupsServer.js"; import { OnOffServer as BaseOnOffServer } from "../behaviors/on-off/OnOffServer.js"; import { LevelControlServer as BaseLevelControlServer } from "../behaviors/level-control/LevelControlServer.js"; import { ScenesManagementServer as BaseScenesManagementServer } from "../behaviors/scenes-management/ScenesManagementServer.js"; import { OccupancySensingClient as BaseOccupancySensingClient } from "../behaviors/occupancy-sensing/OccupancySensingClient.js"; import { MutableEndpoint } from "../endpoint/type/MutableEndpoint.js"; import { SupportedBehaviors } from "../endpoint/properties/SupportedBehaviors.js"; import { Identity } from "@matter/general"; /** * A Dimmable Light is a lighting device that is capable of being switched on or off and the intensity of its light * adjusted by means of a bound controller device such as a Dimmer Switch or a Color Dimmer Switch. In addition, a * Dimmable Light device is also capable of being switched by means of a bound occupancy sensor or other device(s). * * @see {@link MatterSpecification.v161.Device} ยง 4.2 */ export interface DimmableLightDevice extends Identity {} export namespace DimmableLightRequirements { /** * The Identify cluster is required by the Matter specification. * * This version of {@link IdentifyServer} is specialized per the specification. */ export const IdentifyServer = BaseIdentifyServer.alter({ commands: { triggerEffect: { optional: false } } }); /** * The Groups cluster is required by the Matter specification. * * We provide this alias to the default implementation {@link GroupsServer} for convenience. */ export const GroupsServer = BaseGroupsServer; /** * The OnOff cluster is required by the Matter specification. * * This version of {@link OnOffServer} is specialized per the specification. */ export const OnOffServer = BaseOnOffServer.with("Lighting"); /** * The LevelControl cluster is required by the Matter specification. * * This version of {@link LevelControlServer} is specialized per the specification. */ export const LevelControlServer = BaseLevelControlServer .with("Lighting", "OnOff") .alter({ attributes: { currentLevel: { min: 1, max: 254 }, minLevel: { min: 1, max: 1, default: 1 }, maxLevel: { min: 254, max: 254, default: 254 } } }); /** * The ScenesManagement cluster is required by the Matter specification. * * This version of {@link ScenesManagementServer} is specialized per the specification. */ export const ScenesManagementServer = BaseScenesManagementServer .alter({ commands: { copyScene: { optional: false } } }); /** * The OccupancySensing cluster is optional per the Matter specification. * * We provide this alias to the default implementation {@link OccupancySensingClient} for convenience. */ export const OccupancySensingClient = BaseOccupancySensingClient; /** * An implementation for each server cluster supported by the endpoint per the Matter specification. */ export const server = { mandatory: { Identify: IdentifyServer, Groups: GroupsServer, OnOff: OnOffServer, LevelControl: LevelControlServer, ScenesManagement: ScenesManagementServer } }; /** * A definition for each client cluster supported by the endpoint per the Matter specification. */ export const client = { optional: { OccupancySensing: OccupancySensingClient } }; } export const DimmableLightDeviceDefinition = MutableEndpoint({ name: "DimmableLight", deviceType: 0x101, deviceRevision: 4, requirements: DimmableLightRequirements, behaviors: SupportedBehaviors( DimmableLightRequirements.server.mandatory.Identify, DimmableLightRequirements.server.mandatory.Groups, DimmableLightRequirements.server.mandatory.OnOff, DimmableLightRequirements.server.mandatory.LevelControl, DimmableLightRequirements.server.mandatory.ScenesManagement ) }); Object.freeze(DimmableLightDeviceDefinition); export const DimmableLightDevice: DimmableLightDevice = DimmableLightDeviceDefinition;