diff --git a/lib/extension/bind.js b/lib/extension/bind.js index cb2f5bbde..60cfbc73f 100644 --- a/lib/extension/bind.js +++ b/lib/extension/bind.js @@ -71,6 +71,7 @@ const pollOnMessage = [ {type: 'commandMoveWithOnOff', data: {}}, {type: 'commandStopWithOnOff', data: {}}, {type: 'commandMove', data: {}}, + {type: 'commandMoveToLevelWithOnOff', data: {}}, ], }, // Read the following attributes @@ -85,10 +86,17 @@ const pollOnMessage = [ }, { cluster: { + genLevelCtrl: [ + {type: 'commandStepWithOnOff', data: {}}, + {type: 'commandMoveWithOnOff', data: {}}, + {type: 'commandStopWithOnOff', data: {}}, + {type: 'commandMoveToLevelWithOnOff', data: {}}, + ], genOnOff: [ {type: 'commandOn', data: {}}, {type: 'commandOff', data: {}}, {type: 'commandOffWithEffect', data: {}}, + {type: 'commandToggle', data: {}}, ], manuSpecificPhilips: [ {type: 'commandHueNotification', data: {button: 1}}, diff --git a/test/bind.test.js b/test/bind.test.js index 3a1619196..9323ffc57 100644 --- a/test/bind.test.js +++ b/test/bind.test.js @@ -519,15 +519,16 @@ describe('Bind', () => { const payload = {data, cluster: 'genLevelCtrl', device: remote, endpoint: remote.getEndpoint(1), type: 'commandStepWithOnOff', linkquality: 10, groupID: 15071}; await zigbeeHerdsman.events.message(payload); await flushPromises(); - expect(debounce).toHaveBeenCalledTimes(1); - expect(zigbeeHerdsman.devices.bulb_color_2.getEndpoint(1).read).toHaveBeenCalledTimes(1); + expect(debounce).toHaveBeenCalledTimes(2); + expect(zigbeeHerdsman.devices.bulb_color_2.getEndpoint(1).read).toHaveBeenCalledTimes(2); expect(zigbeeHerdsman.devices.bulb_color_2.getEndpoint(1).read).toHaveBeenCalledWith("genLevelCtrl", ["currentLevel"]); + expect(zigbeeHerdsman.devices.bulb_color_2.getEndpoint(1).read).toHaveBeenCalledWith("genOnOff", ["onOff"]); // Should also only debounce once await zigbeeHerdsman.events.message(payload); await flushPromises(); - expect(debounce).toHaveBeenCalledTimes(1); - expect(zigbeeHerdsman.devices.bulb_color_2.getEndpoint(1).read).toHaveBeenCalledTimes(2); + expect(debounce).toHaveBeenCalledTimes(2); + expect(zigbeeHerdsman.devices.bulb_color_2.getEndpoint(1).read).toHaveBeenCalledTimes(4); // Should only call Hue bulb, not e.g. tradfri expect(zigbeeHerdsman.devices.bulb_2.getEndpoint(1).read).toHaveBeenCalledTimes(0);