diff --git a/index.d.ts b/index.d.ts index 3c3a66f..0947555 100644 --- a/index.d.ts +++ b/index.d.ts @@ -315,7 +315,10 @@ declare module "zigbee-clusters" { }, ): Promise; } - type OnOffSwitchClusterAttributes = Record; + type OnOffSwitchClusterAttributes = { + switchType: { id: 0x00, type: ZCLDataType<"toggle" | "momentary" | "multifunction"> }, + switchActions: { id: 0x10, type: ZCLDataType<"onOff" | "offOn" | "toggle"> }, + }; type OnOffSwitchClusterCommands = Record; class OnOffSwitchCluster extends Cluster { } diff --git a/lib/clusters/onOffSwitch.js b/lib/clusters/onOffSwitch.js index 2d188ab..81a3219 100644 --- a/lib/clusters/onOffSwitch.js +++ b/lib/clusters/onOffSwitch.js @@ -1,8 +1,12 @@ 'use strict'; const Cluster = require('../Cluster'); +const { ZCLDataTypes } = require('../zclTypes'); -const ATTRIBUTES = {}; +const ATTRIBUTES = { + switchType: { id: 0, type: ZCLDataTypes.enum8({ toggle: 0, momentary: 1, multifunction: 2 }) }, + switchActions: { id: 16, type: ZCLDataTypes.enum8({ onOff: 0, offOn: 1, toggle: 2 }) }, +}; const COMMANDS = {};