Skip to content

Commit e9809c7

Browse files
authored
Merge pull request #228 from athombv/master
MMIP (#minor)
2 parents 76eef15 + 8fcef48 commit e9809c7

2 files changed

Lines changed: 9 additions & 2 deletions

File tree

‎index.d.ts‎

Lines changed: 4 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -315,7 +315,10 @@ declare module "zigbee-clusters" {
315315
},
316316
): Promise<void>;
317317
}
318-
type OnOffSwitchClusterAttributes = Record<never, never>;
318+
type OnOffSwitchClusterAttributes = {
319+
switchType: { id: 0x00, type: ZCLDataType<"toggle" | "momentary" | "multifunction"> },
320+
switchActions: { id: 0x10, type: ZCLDataType<"onOff" | "offOn" | "toggle"> },
321+
};
319322
type OnOffSwitchClusterCommands = Record<never, never>;
320323
class OnOffSwitchCluster<Attributes extends types.AttributeDefinitions = OnOffSwitchClusterAttributes, Commands extends types.CommandDefinitions = OnOffSwitchClusterCommands> extends Cluster<Attributes, Commands> {
321324
}

‎lib/clusters/onOffSwitch.js‎

Lines changed: 5 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,8 +1,12 @@
11
'use strict';
22

33
const Cluster = require('../Cluster');
4+
const { ZCLDataTypes } = require('../zclTypes');
45

5-
const ATTRIBUTES = {};
6+
const ATTRIBUTES = {
7+
switchType: { id: 0, type: ZCLDataTypes.enum8({ toggle: 0, momentary: 1, multifunction: 2 }) },
8+
switchActions: { id: 16, type: ZCLDataTypes.enum8({ onOff: 0, offOn: 1, toggle: 2 }) },
9+
};
610

711
const COMMANDS = {};
812

0 commit comments

Comments
 (0)