From 30a809b6b86f390e30088e8b037b4b7b28e9a24d Mon Sep 17 00:00:00 2001 From: Oliver Fuhr Date: Mon, 23 Nov 2020 19:51:30 +0100 Subject: [PATCH] Added converters for brightness_move and brightness_step for Busch-Jaeger RM01 --- converters/toZigbee.js | 22 ++++++++++++++++++++++ devices.js | 2 +- 2 files changed, 23 insertions(+), 1 deletion(-) diff --git a/converters/toZigbee.js b/converters/toZigbee.js index 2db0e3ad5757b..7a3eb61f146c0 100644 --- a/converters/toZigbee.js +++ b/converters/toZigbee.js @@ -2831,6 +2831,28 @@ const converters = { } }, }, + RM01_light_brightness_step: { + key: ['brightness_step', 'brightness_step_onoff'], + convertSet: async (entity, key, value, meta) => { + if (utils.hasEndpoints(meta.device, [0x12])) { + const endpoint = meta.device.getEndpoint(0x12); + return await converters.light_brightness_step.convertSet(endpoint, key, value, meta); + } else { + throw new Error('LevelControl not supported on this RM01 device.'); + } + }, + }, + RM01_light_brightness_move: { + key: ['brightness_move', 'brightness_move_onoff'], + convertSet: async (entity, key, value, meta) => { + if (utils.hasEndpoints(meta.device, [0x12])) { + const endpoint = meta.device.getEndpoint(0x12); + return await converters.light_brightness_move.convertSet(endpoint, key, value, meta); + } else { + throw new Error('LevelControl not supported on this RM01 device.'); + } + }, + }, aqara_opple_operation_mode: { key: ['operation_mode'], convertSet: async (entity, key, value, meta) => { diff --git a/devices.js b/devices.js index e2f6aaf61e19e..63b890df74014 100755 --- a/devices.js +++ b/devices.js @@ -9717,7 +9717,7 @@ const devices = [ fz.ignore_basic_report, fz.on_off, fz.brightness, fz.RM01_on_click, fz.RM01_off_click, fz.RM01_up_hold, fz.RM01_down_hold, fz.RM01_stop, ], - toZigbee: [tz.RM01_light_onoff_brightness], + toZigbee: [tz.RM01_light_onoff_brightness, tz.RM01_light_brightness_step, tz.RM01_light_brightness_move], onEvent: async (type, data, device) => { const switchEndpoint = device.getEndpoint(0x12); if (switchEndpoint == null) {