diff --git a/src/devices/yandex.ts b/src/devices/yandex.ts index e8dfa05d4ca1a..e98736f09cb37 100644 --- a/src/devices/yandex.ts +++ b/src/devices/yandex.ts @@ -91,6 +91,7 @@ function YandexCluster(): ModernExtend { powerType: {ID: 0x0003, type: Zcl.DataType.ENUM8}, ledIndicator: {ID: 0x0005, type: Zcl.DataType.BOOLEAN}, interlock: {ID: 0x0007, type: Zcl.DataType.BOOLEAN}, + buttonMode: {ID: 0x0008, type: Zcl.DataType.ENUM8}, }, commands: { switchMode: { @@ -113,6 +114,10 @@ function YandexCluster(): ModernExtend { ID: 0x07, parameters: [{name: "value", type: Zcl.DataType.UINT8}], }, + buttonMode: { + ID: 0x08, + parameters: [{name: "value", type: Zcl.DataType.UINT8}], + }, }, commandsResponse: {}, }); @@ -431,4 +436,44 @@ export const definitions: DefinitionWithExtend[] = [ }), ], }, + { + zigbeeModel: ["YNDX-00530"], + model: "YNDX_00530", + vendor: "Yandex", + description: "Dimmer", + extend: [ + YandexCluster(), + m.light({ + effect: true, + powerOnBehavior: true, + configureReporting: true, + levelReportingConfig: {min: "MIN", max: "MAX", change: 1}, + }), + m.lightingBallast(), + binaryWithSetCommand({ + name: "led_indicator", + cluster: "manuSpecificYandex", + attribute: "ledIndicator", + valueOn: ["ON", 1], + valueOff: ["OFF", 0], + setCommand: "ledIndicator", + zigbeeCommandOptions: {manufacturerCode}, + description: "Led indicator", + entityCategory: "config", + }), + enumLookupWithSetCommand({ + name: "button_mode", + cluster: "manuSpecificYandex", + attribute: "buttonMode", + setCommand: "buttonMode", + zigbeeCommandOptions: {manufacturerCode}, + description: "Dimmer button mode", + lookup: { + general: 0x00, + alternative: 0x01, + }, + entityCategory: "config", + }), + ], + }, ]; diff --git a/src/lib/modernExtend.ts b/src/lib/modernExtend.ts index e2d4cc0015a6b..a215a9a1324ab 100644 --- a/src/lib/modernExtend.ts +++ b/src/lib/modernExtend.ts @@ -989,6 +989,7 @@ export interface LightArgs { endpointNames?: string[]; ota?: ModernExtend["ota"]; levelConfig?: {disabledFeatures?: LevelConfigFeatures}; + levelReportingConfig?: ReportingConfigWithoutAttribute; } export function light(args?: LightArgs): ModernExtend { // biome-ignore lint/style/noParameterAssign: ignored using `--suppress` @@ -1087,7 +1088,7 @@ export function light(args?: LightArgs): ModernExtend { if (args.configureReporting) { await setupAttributes(device, coordinatorEndpoint, "genOnOff", [{attribute: "onOff", min: "MIN", max: "MAX", change: 1}]); await setupAttributes(device, coordinatorEndpoint, "genLevelCtrl", [ - {attribute: "currentLevel", min: "10_SECONDS", max: "MAX", change: 1}, + {attribute: "currentLevel", min: "10_SECONDS", max: "MAX", change: 1, ...(args.levelReportingConfig || {})}, ]); if (args.colorTemp) { await setupAttributes(device, coordinatorEndpoint, "lightingColorCtrl", [