zigbee-herdsman-converters 15.0.41 → 15.0.42

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
@@ -4773,17 +4773,6 @@ const converters = {
4773
4773
  });
4774
4774
  },
4775
4775
  },
4776
- tuya_min_brightness: {
4777
- cluster: 'genLevelCtrl',
4778
- type: ['attributeReport', 'readResponse'],
4779
- convert: (model, msg, publish, options, meta) => {
4780
- if (msg.data.hasOwnProperty(0xfc00)) {
4781
- const property = postfixWithEndpointName('min_brightness', msg, model, meta);
4782
- const value = parseInt(msg.data[0xfc00].toString(16).slice(0, 2), 16);
4783
- return {[property]: value};
4784
- }
4785
- },
4786
- },
4787
4776
  restorable_brightness: {
4788
4777
  cluster: 'genLevelCtrl',
4789
4778
  type: ['attributeReport', 'readResponse'],
@@ -5461,7 +5450,7 @@ const converters = {
5461
5450
  if (['QBKG39LM', 'QBKG41LM', 'WS-EUK02', 'WS-EUK04', 'QBKG20LM', 'QBKG31LM'].includes(model.model)) {
5462
5451
  buttonLookup = {41: 'left', 42: 'right', 51: 'both'};
5463
5452
  }
5464
- if (['QBKG25LM', 'QBKG26LM', 'QBKG34LM'].includes(model.model)) {
5453
+ if (['QBKG25LM', 'QBKG26LM', 'QBKG34LM', 'ZNQBKG31LM'].includes(model.model)) {
5465
5454
  buttonLookup = {
5466
5455
  41: 'left', 42: 'center', 43: 'right',
5467
5456
  51: 'left_center', 52: 'left_right', 53: 'center_right',
@@ -2145,7 +2145,7 @@ const converters = {
2145
2145
  if (['SP-EUC01', 'ZNCZ04LM', 'ZNCZ12LM', 'ZNCZ15LM', 'QBCZ14LM', 'QBCZ15LM', 'SSM-U01', 'SSM-U02', 'DLKZMK11LM', 'DLKZMK12LM',
2146
2146
  'WS-EUK01', 'WS-EUK02', 'WS-EUK03', 'WS-EUK04', 'QBKG19LM', 'QBKG20LM', 'QBKG25LM', 'QBKG26LM',
2147
2147
  'QBKG31LM', 'QBKG34LM', 'QBKG38LM', 'QBKG39LM', 'QBKG40LM', 'QBKG41LM', 'ZNDDMK11LM', 'ZNLDP13LM',
2148
- 'WS-USC02', 'WS-USC04',
2148
+ 'WS-USC02', 'WS-USC04', 'ZNQBKG31LM',
2149
2149
  ].includes(meta.mapped.model)) {
2150
2150
  await entity.write('aqaraOpple', {0x0201: {value: value ? 1 : 0, type: 0x10}}, manufacturerOptions.xiaomi);
2151
2151
  } else if (['ZNCZ02LM', 'QBCZ11LM', 'LLKZMK11LM'].includes(meta.mapped.model)) {
@@ -2170,7 +2170,7 @@ const converters = {
2170
2170
  if (['SP-EUC01', 'ZNCZ04LM', 'ZNCZ12LM', 'ZNCZ15LM', 'QBCZ14LM', 'QBCZ15LM', 'SSM-U01', 'SSM-U02', 'DLKZMK11LM', 'DLKZMK12LM',
2171
2171
  'WS-EUK01', 'WS-EUK02', 'WS-EUK03', 'WS-EUK04', 'QBKG19LM', 'QBKG20LM', 'QBKG25LM', 'QBKG26LM',
2172
2172
  'QBKG31LM', 'QBKG34LM', 'QBKG38LM', 'QBKG39LM', 'QBKG40LM', 'QBKG41LM', 'ZNDDMK11LM', 'ZNLDP13LM',
2173
- 'WS-USC02', 'WS-USC04',
2173
+ 'WS-USC02', 'WS-USC04', 'ZNQBKG31LM',
2174
2174
  ].includes(meta.mapped.model)) {
2175
2175
  await entity.read('aqaraOpple', [0x0201]);
2176
2176
  } else if (['ZNCZ02LM', 'QBCZ11LM', 'ZNCZ11LM'].includes(meta.mapped.model)) {
@@ -3828,20 +3828,6 @@ const converters = {
3828
3828
  return {state: {state: value.toUpperCase()}};
3829
3829
  },
3830
3830
  },
3831
- tuya_min_brightness: {
3832
- key: ['min_brightness'],
3833
- convertSet: async (entity, key, value, meta) => {
3834
- const minValueHex = value.toString(16);
3835
- const maxValueHex = 'ff';
3836
- const minMaxValue = parseInt(`${minValueHex}${maxValueHex}`, 16);
3837
- const payload = {0xfc00: {value: minMaxValue, type: 0x21}};
3838
- await entity.write('genLevelCtrl', payload, {disableDefaultResponse: true});
3839
- return {state: {min_brightness: value}};
3840
- },
3841
- convertGet: async (entity, key, meta) => {
3842
- await entity.read('genLevelCtrl', [0xfc00]);
3843
- },
3844
- },
3845
3831
  frankever_threshold: {
3846
3832
  key: ['threshold'],
3847
3833
  convertSet: async (entity, key, value, meta) => {
@@ -6622,23 +6608,6 @@ const converters = {
6622
6608
  }
6623
6609
  },
6624
6610
  },
6625
- tuya_do_not_disturb: {
6626
- key: ['do_not_disturb'],
6627
- convertSet: async (entity, key, value, meta) => {
6628
- await entity.command('lightingColorCtrl', 'tuyaDoNotDisturb', {enable: value ? 1 : 0});
6629
- return {state: {do_not_disturb: value}};
6630
- },
6631
- },
6632
- tuya_color_power_on_behavior: {
6633
- key: ['color_power_on_behavior'],
6634
- convertSet: async (entity, key, value, meta) => {
6635
- const lookup = {'initial': 0, 'previous': 1, 'cutomized': 2};
6636
- utils.validateValue(value, Object.keys(lookup));
6637
- await entity.command('lightingColorCtrl', 'tuyaOnStartUp', {
6638
- mode: lookup[value]*256, data: [0, 0, 0, 0, 0, 0, 0, 0, 0, 0]});
6639
- return {state: {color_power_on_behavior: value}};
6640
- },
6641
- },
6642
6611
  tuya_motion_sensor: {
6643
6612
  key: ['o_sensitivity', 'v_sensitivity', 'led_status', 'vacancy_delay',
6644
6613
  'light_on_luminance_prefer', 'light_off_luminance_prefer', 'mode'],
@@ -1,4 +1,5 @@
1
1
  const extend = require('../lib/extend');
2
+ const tuya = require('../lib/tuya');
2
3
 
3
4
  module.exports = [
4
5
  {
@@ -35,7 +36,7 @@ module.exports = [
35
36
  model: 'AJ_RGBCCT_CTRL',
36
37
  vendor: 'Ajax Online',
37
38
  description: 'Smart Zigbee LED strip RGB+CCT',
38
- extend: extend.light_onoff_brightness_colortemp_color({colorTempRange: [153, 500], disableColorTempStartup: true}),
39
+ extend: tuya.extend.light_onoff_brightness_colortemp_color({colorTempRange: [153, 500]}),
39
40
  meta: {applyRedFix: true, enhancedHue: false},
40
41
  },
41
42
  {
package/devices/aldi.js CHANGED
@@ -1,6 +1,6 @@
1
1
  const exposes = require('../lib/exposes');
2
2
  const fz = {...require('../converters/fromZigbee'), legacy: require('../lib/legacy').fromZigbee};
3
- const extend = require('../lib/extend');
3
+ const tuya = require('../lib/tuya');
4
4
  const e = exposes.presets;
5
5
 
6
6
  module.exports = [
@@ -9,7 +9,7 @@ module.exports = [
9
9
  model: 'L122FF63H11A5.0W',
10
10
  vendor: 'Aldi',
11
11
  description: 'LIGHTWAY smart home LED-lamp - spot',
12
- extend: extend.light_onoff_brightness_colortemp_color({disableColorTempStartup: true}),
12
+ extend: tuya.extend.light_onoff_brightness_colortemp_color(),
13
13
  meta: {applyRedFix: true},
14
14
  },
15
15
  {
@@ -17,31 +17,28 @@ module.exports = [
17
17
  model: 'L122AA63H11A6.5W',
18
18
  vendor: 'Aldi',
19
19
  description: 'LIGHTWAY smart home LED-lamp - candle',
20
- extend: extend.light_onoff_brightness_colortemp_color({disableColorTempStartup: true}),
21
- meta: {applyRedFix: true},
20
+ extend: tuya.extend.light_onoff_brightness_colortemp_color(),
22
21
  },
23
22
  {
24
23
  fingerprint: [{modelID: 'TS0502B', manufacturerName: '_TZ3000_g1glzzfk'}],
25
24
  model: 'F122SB62H22A4.5W',
26
25
  vendor: 'Aldi',
27
26
  description: 'LIGHTWAY smart home LED-lamp - filament',
28
- extend: extend.light_onoff_brightness_colortemp({disableColorTempStartup: true}),
27
+ extend: tuya.extend.light_onoff_brightness_colortemp(),
29
28
  },
30
29
  {
31
30
  fingerprint: [{modelID: 'TS0505B', manufacturerName: '_TZ3000_v1srfw9x'}],
32
31
  model: 'C422AC11D41H140.0W',
33
32
  vendor: 'Aldi',
34
33
  description: 'MEGOS LED panel RGB+CCT 40W 3600lm 62 x 62 cm',
35
- extend: extend.light_onoff_brightness_colortemp_color({disableColorTempStartup: true}),
36
- meta: {applyRedFix: true},
34
+ extend: tuya.extend.light_onoff_brightness_colortemp_color(),
37
35
  },
38
36
  {
39
37
  fingerprint: [{modelID: 'TS0505B', manufacturerName: '_TZ3000_gb5gaeca'}],
40
38
  model: 'C422AC14D41H140.0W',
41
39
  vendor: 'Aldi',
42
40
  description: 'MEGOS LED panel RGB+CCT 40W 3600lm 30 x 120 cm',
43
- extend: extend.light_onoff_brightness_colortemp_color({disableColorTempStartup: true}),
44
- meta: {applyRedFix: true},
41
+ extend: tuya.extend.light_onoff_brightness_colortemp_color(),
45
42
  },
46
43
  {
47
44
  fingerprint: [{modelID: 'TS1001', manufacturerName: '_TZ3000_ztrfrcsu'}],
package/devices/ecodim.js CHANGED
@@ -4,6 +4,7 @@ const e = exposes.presets;
4
4
  const reporting = require('../lib/reporting');
5
5
  const extend = require('../lib/extend');
6
6
  const ota = require('../lib/ota');
7
+ const tuya = require('../lib/tuya');
7
8
 
8
9
  module.exports = [
9
10
  {
@@ -131,7 +132,7 @@ module.exports = [
131
132
  model: 'ED-10042',
132
133
  vendor: 'EcoDim',
133
134
  description: 'Zigbee LED filament light dimmable E27, globe G125, flame 2200K',
134
- extend: extend.light_onoff_brightness(),
135
+ extend: tuya.extend.light_onoff_brightness(),
135
136
  },
136
137
  {
137
138
  fingerprint: [{modelID: 'CCT Light', manufacturerName: 'ZigBee/CCT', manufacturerID: 4137},
@@ -139,6 +140,6 @@ module.exports = [
139
140
  model: 'ED-10041',
140
141
  vendor: 'EcoDim',
141
142
  description: 'Zigbee LED filament light dimmable E27, edison ST64, flame 2200K',
142
- extend: extend.light_onoff_brightness_colortemp({colorTempRange: [153, 454]}),
143
+ extend: tuya.extend.light_onoff_brightness_colortemp({colorTempRange: [153, 454]}),
143
144
  },
144
145
  ];
package/devices/garza.js CHANGED
@@ -1,4 +1,4 @@
1
- const extend = require('../lib/extend');
1
+ const tuya = require('../lib/tuya');
2
2
 
3
3
  module.exports = [
4
4
  {
@@ -6,6 +6,6 @@ module.exports = [
6
6
  model: 'Garza-Standard-A60',
7
7
  vendor: 'Garza Smart',
8
8
  description: 'Standard A60 bulb',
9
- extend: extend.light_onoff_brightness_colortemp_color({colorTempRange: [153, 500]}),
9
+ extend: tuya.extend.light_onoff_brightness_colortemp_color({colorTempRange: [153, 500]}),
10
10
  },
11
11
  ];
package/devices/immax.js CHANGED
@@ -58,7 +58,7 @@ module.exports = [
58
58
  model: '07743L',
59
59
  vendor: 'Immax',
60
60
  description: 'Neo Smart LED E27 11W RGB + CCT, color, dimmable, Zigbee 3.0',
61
- extend: extend.light_onoff_brightness_colortemp_color({colorTempRange: [153, 500]}),
61
+ extend: tuya.extend.light_onoff_brightness_colortemp_color({colorTempRange: [153, 500]}),
62
62
  },
63
63
  {
64
64
  zigbeeModel: ['Keyfob-ZB3.0'],
package/devices/lidl.js CHANGED
@@ -511,8 +511,7 @@ module.exports = [
511
511
  model: 'HG06104A',
512
512
  vendor: 'Lidl',
513
513
  description: 'Livarno Lux smart LED light strip 2.5m',
514
- ...extend.light_onoff_brightness_colortemp_color({disableColorTempStartup: true, disablePowerOnBehavior: true}),
515
- meta: {applyRedFix: true, enhancedHue: false},
514
+ extend: tuya.extend.light_onoff_brightness_colortemp_color({noConfigure: true}),
516
515
  configure: async (device, coordinatorEndpoint, logger) => {
517
516
  device.getEndpoint(1).saveClusterAttributeKeyValue('lightingColorCtrl', {colorCapabilities: 29});
518
517
  },
@@ -531,8 +530,7 @@ module.exports = [
531
530
  model: 'HG06106B',
532
531
  vendor: 'Lidl',
533
532
  description: 'Livarno Lux E14 candle RGB',
534
- ...extend.light_onoff_brightness_colortemp_color({disableColorTempStartup: true, disablePowerOnBehavior: true}),
535
- meta: {applyRedFix: true, enhancedHue: false},
533
+ extend: tuya.extend.light_onoff_brightness_colortemp_color({noConfigure: true}),
536
534
  configure: async (device, coordinatorEndpoint, logger) => {
537
535
  device.getEndpoint(1).saveClusterAttributeKeyValue('lightingColorCtrl', {colorCapabilities: 29});
538
536
  },
@@ -542,9 +540,7 @@ module.exports = [
542
540
  model: '14153806L',
543
541
  vendor: 'Lidl',
544
542
  description: 'Livarno smart LED ceiling light',
545
- ...extend.light_onoff_brightness_colortemp_color(
546
- {disableColorTempStartup: true, disablePowerOnBehavior: true, colorTempRange: [153, 500]}),
547
- meta: {applyRedFix: true, enhancedHue: false},
543
+ extend: tuya.extend.light_onoff_brightness_colortemp_color({colorTempRange: [153, 500], noConfigure: true}),
548
544
  configure: async (device, coordinatorEndpoint, logger) => {
549
545
  device.getEndpoint(1).saveClusterAttributeKeyValue('lightingColorCtrl', {colorCapabilities: 29});
550
546
  },
@@ -554,9 +550,7 @@ module.exports = [
554
550
  model: '14156506L',
555
551
  vendor: 'Lidl',
556
552
  description: 'Livarno Lux smart LED mood light',
557
- ...extend.light_onoff_brightness_colortemp_color(
558
- {disableColorTempStartup: true, disablePowerOnBehavior: true, colorTempRange: [153, 500]}),
559
- meta: {applyRedFix: true, enhancedHue: false},
553
+ extend: tuya.extend.light_onoff_brightness_colortemp_color({colorTempRange: [153, 500], noConfigure: true}),
560
554
  configure: async (device, coordinatorEndpoint, logger) => {
561
555
  device.getEndpoint(1).saveClusterAttributeKeyValue('lightingColorCtrl', {colorCapabilities: 29});
562
556
  },
@@ -566,9 +560,7 @@ module.exports = [
566
560
  model: '14156408L',
567
561
  vendor: 'Lidl',
568
562
  description: 'Livarno Lux smart LED ceiling light',
569
- ...extend.light_onoff_brightness_colortemp(
570
- {disableColorTempStartup: true, disablePowerOnBehavior: true, colorTempRange: [153, 500]}),
571
- meta: {applyRedFix: true, enhancedHue: false},
563
+ extend: tuya.extend.light_onoff_brightness_colortemp_color({colorTempRange: [153, 500], noConfigure: true}),
572
564
  configure: async (device, coordinatorEndpoint, logger) => {
573
565
  device.getEndpoint(1).saveClusterAttributeKeyValue('lightingColorCtrl', {colorCapabilities: 16});
574
566
  },
@@ -578,9 +570,7 @@ module.exports = [
578
570
  model: 'HG08010',
579
571
  vendor: 'Lidl',
580
572
  description: 'Livarno Home outdoor spotlight',
581
- ...extend.light_onoff_brightness_colortemp_color(
582
- {disableColorTempStartup: true, disablePowerOnBehavior: true, colorTempRange: [153, 500]}),
583
- meta: {applyRedFix: true, enhancedHue: false},
573
+ extend: tuya.extend.light_onoff_brightness_colortemp_color({colorTempRange: [153, 500], noConfigure: true}),
584
574
  configure: async (device, coordinatorEndpoint, logger) => {
585
575
  device.getEndpoint(1).saveClusterAttributeKeyValue('lightingColorCtrl', {colorCapabilities: 29});
586
576
  },
@@ -590,9 +580,7 @@ module.exports = [
590
580
  model: 'HG08008',
591
581
  vendor: 'Lidl',
592
582
  description: 'Livarno Home LED ceiling light',
593
- ...extend.light_onoff_brightness_colortemp_color(
594
- {disableColorTempStartup: true, disablePowerOnBehavior: true, colorTempRange: [153, 500]}),
595
- meta: {applyRedFix: true, enhancedHue: false},
583
+ extend: tuya.extend.light_onoff_brightness_colortemp_color({colorTempRange: [153, 500], noConfigure: true}),
596
584
  configure: async (device, coordinatorEndpoint, logger) => {
597
585
  device.getEndpoint(1).saveClusterAttributeKeyValue('lightingColorCtrl', {colorCapabilities: 29});
598
586
  },
@@ -602,18 +590,14 @@ module.exports = [
602
590
  model: 'HG08007',
603
591
  vendor: 'TuYa',
604
592
  description: 'Livarno Home outdoor LED band',
605
- extend: extend.light_onoff_brightness_colortemp_color(
606
- {disableColorTempStartup: true, disablePowerOnBehavior: true, colorTempRange: [153, 500]}),
607
- meta: {applyRedFix: true, enhancedHue: false},
593
+ extend: tuya.extend.light_onoff_brightness_colortemp_color({colorTempRange: [153, 500]}),
608
594
  },
609
595
  {
610
596
  fingerprint: [{modelID: 'TS0505B', manufacturerName: '_TZ3210_z1vlyufu'}],
611
597
  model: '14158704L',
612
598
  vendor: 'Lidl',
613
599
  description: 'Livarno Home LED floor lamp, RGBW',
614
- ...extend.light_onoff_brightness_colortemp_color(
615
- {disableColorTempStartup: true, disablePowerOnBehavior: true, colorTempRange: [153, 500]}),
616
- meta: {applyRedFix: true, enhancedHue: false},
600
+ extend: tuya.extend.light_onoff_brightness_colortemp_color({colorTempRange: [153, 500], noConfigure: true}),
617
601
  configure: async (device, coordinatorEndpoint, logger) => {
618
602
  device.getEndpoint(1).saveClusterAttributeKeyValue('lightingColorCtrl', {colorCapabilities: 29});
619
603
  },
@@ -623,9 +607,7 @@ module.exports = [
623
607
  model: '14158804L',
624
608
  vendor: 'Lidl',
625
609
  description: 'Livarno Home LED desk lamp RGBW',
626
- ...extend.light_onoff_brightness_colortemp_color(
627
- {disableColorTempStartup: true, disablePowerOnBehavior: true, colorTempRange: [153, 500]}),
628
- meta: {applyRedFix: true, enhancedHue: false},
610
+ extend: tuya.extend.light_onoff_brightness_colortemp_color({colorTempRange: [153, 500], noConfigure: true}),
629
611
  configure: async (device, coordinatorEndpoint, logger) => {
630
612
  device.getEndpoint(1).saveClusterAttributeKeyValue('lightingColorCtrl', {colorCapabilities: 29});
631
613
  },
@@ -635,9 +617,7 @@ module.exports = [
635
617
  model: 'HG07834A',
636
618
  vendor: 'Lidl',
637
619
  description: 'Livarno Lux GU10 spot RGB',
638
- ...extend.light_onoff_brightness_colortemp_color(
639
- {disableColorTempStartup: true, disablePowerOnBehavior: true, colorTempRange: [153, 500]}),
640
- meta: {applyRedFix: true, enhancedHue: false},
620
+ extend: tuya.extend.light_onoff_brightness_colortemp_color({colorTempRange: [153, 500], noConfigure: true}),
641
621
  configure: async (device, coordinatorEndpoint, logger) => {
642
622
  device.getEndpoint(1).saveClusterAttributeKeyValue('lightingColorCtrl', {colorCapabilities: 29});
643
623
  },
@@ -648,9 +628,7 @@ module.exports = [
648
628
  model: 'HG07834B',
649
629
  vendor: 'Lidl',
650
630
  description: 'Livarno Lux E14 candle RGB',
651
- ...extend.light_onoff_brightness_colortemp_color(
652
- {disableColorTempStartup: true, disablePowerOnBehavior: true, colorTempRange: [153, 500]}),
653
- meta: {applyRedFix: true, enhancedHue: false},
631
+ extend: tuya.extend.light_onoff_brightness_colortemp_color({colorTempRange: [153, 500], noConfigure: true}),
654
632
  configure: async (device, coordinatorEndpoint, logger) => {
655
633
  device.getEndpoint(1).saveClusterAttributeKeyValue('lightingColorCtrl', {colorCapabilities: 29});
656
634
  },
@@ -660,9 +638,7 @@ module.exports = [
660
638
  model: 'HG08131C',
661
639
  vendor: 'Lidl',
662
640
  description: 'Livarno Home outdoor E27 bulb in set with flare',
663
- ...extend.light_onoff_brightness_colortemp_color(
664
- {disableColorTempStartup: true, disablePowerOnBehavior: true, colorTempRange: [153, 500]}),
665
- meta: {applyRedFix: true, enhancedHue: false},
641
+ extend: tuya.extend.light_onoff_brightness_colortemp_color({colorTempRange: [153, 500], noConfigure: true}),
666
642
  configure: async (device, coordinatorEndpoint, logger) => {
667
643
  device.getEndpoint(1).saveClusterAttributeKeyValue('lightingColorCtrl', {colorCapabilities: 29});
668
644
  },
@@ -672,8 +648,7 @@ module.exports = [
672
648
  model: 'HG06106A',
673
649
  vendor: 'Lidl',
674
650
  description: 'Livarno Lux GU10 spot RGB',
675
- ...extend.light_onoff_brightness_colortemp_color({disableColorTempStartup: true, disablePowerOnBehavior: true}),
676
- meta: {applyRedFix: true, enhancedHue: false},
651
+ extend: tuya.extend.light_onoff_brightness_colortemp_color({noConfigure: true}),
677
652
  configure: async (device, coordinatorEndpoint, logger) => {
678
653
  device.getEndpoint(1).saveClusterAttributeKeyValue('lightingColorCtrl', {colorCapabilities: 29});
679
654
  },
@@ -683,8 +658,7 @@ module.exports = [
683
658
  model: 'HG06106C',
684
659
  vendor: 'Lidl',
685
660
  description: 'Livarno Lux E27 bulb RGB',
686
- ...extend.light_onoff_brightness_colortemp_color({disableColorTempStartup: true, disablePowerOnBehavior: true}),
687
- meta: {applyRedFix: true, enhancedHue: false},
661
+ extend: tuya.extend.light_onoff_brightness_colortemp_color({noConfigure: true}),
688
662
  configure: async (device, coordinatorEndpoint, logger) => {
689
663
  device.getEndpoint(1).saveClusterAttributeKeyValue('lightingColorCtrl', {colorCapabilities: 29});
690
664
  },
@@ -694,9 +668,7 @@ module.exports = [
694
668
  model: 'HG07834C',
695
669
  vendor: 'Lidl',
696
670
  description: 'Livarno Lux E27 bulb RGB',
697
- ...extend.light_onoff_brightness_colortemp_color(
698
- {disableColorTempStartup: true, disablePowerOnBehavior: true, colorTempRange: [153, 500]}),
699
- meta: {applyRedFix: true, enhancedHue: false},
671
+ extend: tuya.extend.light_onoff_brightness_colortemp_color({colorTempRange: [153, 500], noConfigure: true}),
700
672
  configure: async (device, coordinatorEndpoint, logger) => {
701
673
  device.getEndpoint(1).saveClusterAttributeKeyValue('lightingColorCtrl', {colorCapabilities: 29});
702
674
  },
@@ -706,7 +678,7 @@ module.exports = [
706
678
  model: 'HG06492A',
707
679
  vendor: 'Lidl',
708
680
  description: 'Livarno Lux GU10 spot CCT',
709
- ...extend.light_onoff_brightness_colortemp({disableColorTempStartup: true, disablePowerOnBehavior: true}),
681
+ extend: tuya.extend.light_onoff_brightness_colortemp({colorTempRange: [153, 500], noConfigure: true}),
710
682
  configure: async (device, coordinatorEndpoint, logger) => {
711
683
  device.getEndpoint(1).saveClusterAttributeKeyValue('lightingColorCtrl', {colorCapabilities: 16});
712
684
  },
@@ -716,8 +688,7 @@ module.exports = [
716
688
  model: 'HG06492B',
717
689
  vendor: 'Lidl',
718
690
  description: 'Livarno Lux E14 candle CCT',
719
- ...extend.light_onoff_brightness_colortemp(
720
- {disableColorTempStartup: true, disablePowerOnBehavior: true, colorTempRange: [153, 500]}),
691
+ extend: tuya.extend.light_onoff_brightness_colortemp({colorTempRange: [153, 500], noConfigure: true}),
721
692
  configure: async (device, coordinatorEndpoint, logger) => {
722
693
  device.getEndpoint(1).saveClusterAttributeKeyValue('lightingColorCtrl', {colorCapabilities: 16});
723
694
  },
@@ -727,7 +698,7 @@ module.exports = [
727
698
  model: 'HG06492C',
728
699
  vendor: 'Lidl',
729
700
  description: 'Livarno Lux E27 bulb CCT',
730
- ...extend.light_onoff_brightness_colortemp({disableColorTempStartup: true, disablePowerOnBehavior: true}),
701
+ extend: tuya.extend.light_onoff_brightness_colortemp({colorTempRange: [153, 500], noConfigure: true}),
731
702
  configure: async (device, coordinatorEndpoint, logger) => {
732
703
  device.getEndpoint(1).saveClusterAttributeKeyValue('lightingColorCtrl', {colorCapabilities: 16});
733
704
  },
@@ -738,7 +709,7 @@ module.exports = [
738
709
  model: '14147206L',
739
710
  vendor: 'Lidl',
740
711
  description: 'Livarno Lux ceiling light',
741
- ...extend.light_onoff_brightness_colortemp({disableColorTempStartup: true, disablePowerOnBehavior: true}),
712
+ extend: tuya.extend.light_onoff_brightness_colortemp({colorTempRange: [153, 500], noConfigure: true}),
742
713
  configure: async (device, coordinatorEndpoint, logger) => {
743
714
  device.getEndpoint(1).saveClusterAttributeKeyValue('lightingColorCtrl', {colorCapabilities: 16});
744
715
  },
@@ -748,8 +719,7 @@ module.exports = [
748
719
  model: '14153905L',
749
720
  vendor: 'Lidl',
750
721
  description: 'Livarno Home LED floor lamp',
751
- ...extend.light_onoff_brightness_colortemp(
752
- {disableColorTempStartup: true, disablePowerOnBehavior: true, colorTempRange: [153, 333]}),
722
+ extend: tuya.extend.light_onoff_brightness_colortemp({colorTempRange: [153, 333], noConfigure: true}),
753
723
  configure: async (device, coordinatorEndpoint, logger) => {
754
724
  device.getEndpoint(1).saveClusterAttributeKeyValue('lightingColorCtrl', {colorCapabilities: 16});
755
725
  },
@@ -759,8 +729,7 @@ module.exports = [
759
729
  model: '14148906L',
760
730
  vendor: 'Lidl',
761
731
  description: 'Livarno Lux mood light RGB+CCT',
762
- ...extend.light_onoff_brightness_colortemp_color({disableColorTempStartup: true, disablePowerOnBehavior: true}),
763
- meta: {applyRedFix: true, enhancedHue: false},
732
+ extend: tuya.extend.light_onoff_brightness_colortemp_color({noConfigure: true}),
764
733
  configure: async (device, coordinatorEndpoint, logger) => {
765
734
  device.getEndpoint(1).saveClusterAttributeKeyValue('lightingColorCtrl', {colorCapabilities: 29});
766
735
  },
@@ -771,8 +740,7 @@ module.exports = [
771
740
  model: '14149505L/14149506L',
772
741
  vendor: 'Lidl',
773
742
  description: 'Livarno Lux light bar RGB+CCT (black/white)',
774
- ...extend.light_onoff_brightness_colortemp_color({disableColorTempStartup: true, disablePowerOnBehavior: true}),
775
- meta: {applyRedFix: true, enhancedHue: false},
743
+ extend: tuya.extend.light_onoff_brightness_colortemp_color({noConfigure: true}),
776
744
  configure: async (device, coordinatorEndpoint, logger) => {
777
745
  device.getEndpoint(1).saveClusterAttributeKeyValue('lightingColorCtrl', {colorCapabilities: 29});
778
746
  },
@@ -794,7 +762,7 @@ module.exports = [
794
762
  model: 'HG06463A',
795
763
  vendor: 'Lidl',
796
764
  description: 'Livarno Lux E27 ST64 filament bulb',
797
- extend: extend.light_onoff_brightness({disableEffect: true, disablePowerOnBehavior: true}),
765
+ extend: tuya.extend.light_onoff_brightness(),
798
766
  meta: {turnsOffAtBrightness1: false},
799
767
  },
800
768
  {
@@ -802,7 +770,7 @@ module.exports = [
802
770
  model: 'HG06463B',
803
771
  vendor: 'Lidl',
804
772
  description: 'Livarno Lux E27 G95 filament bulb',
805
- extend: extend.light_onoff_brightness({disableEffect: true, disablePowerOnBehavior: true}),
773
+ extend: tuya.extend.light_onoff_brightness(),
806
774
  meta: {turnsOffAtBrightness1: false},
807
775
  },
808
776
  {
@@ -825,7 +793,7 @@ module.exports = [
825
793
  model: 'HG06462A',
826
794
  vendor: 'Lidl',
827
795
  description: 'Livarno Lux E27 A60 filament bulb',
828
- extend: extend.light_onoff_brightness({disableEffect: true, disablePowerOnBehavior: true}),
796
+ extend: tuya.extend.light_onoff_brightness(),
829
797
  meta: {turnsOffAtBrightness1: false},
830
798
  },
831
799
  {
@@ -845,18 +813,14 @@ module.exports = [
845
813
  model: 'HG08633',
846
814
  vendor: 'Lidl',
847
815
  description: 'Livarno gardenspot RGB',
848
- extend: extend.light_onoff_brightness_colortemp_color({supportsHS: true, preferHS: true, colorTempRange: [153, 500],
849
- disableColorTempStartup: true, disablePowerOnBehavior: true}),
850
- meta: {enhancedHue: false},
816
+ extend: tuya.extend.light_onoff_brightness_colortemp_color({supportsHS: true, preferHS: true, colorTempRange: [153, 500]}),
851
817
  },
852
818
  {
853
819
  fingerprint: [{modelID: 'TS0505B', manufacturerName: '_TZ3000_bwlvyjwk'}],
854
820
  model: 'HG08383B',
855
821
  vendor: 'Lidl',
856
822
  description: 'Livarno outdoor LED light chain',
857
- extend: extend.light_onoff_brightness_colortemp_color(
858
- {colorTempRange: [153, 500], disableColorTempStartup: true, disablePowerOnBehavior: true}),
859
- meta: {applyRedFix: true, enhancedHue: false},
823
+ extend: tuya.extend.light_onoff_brightness_colortemp_color({colorTempRange: [153, 500]}),
860
824
  },
861
825
  {
862
826
  fingerprint: [{modelID: 'TS0601', manufacturerName: '_TZE200_chyvmhay'}],
@@ -919,8 +883,6 @@ module.exports = [
919
883
  model: 'HG08383A',
920
884
  vendor: 'Lidl',
921
885
  description: 'Livarno outdoor LED light chain',
922
- extend: extend.light_onoff_brightness_colortemp_color(
923
- {colorTempRange: [153, 500], disableColorTempStartup: true, disablePowerOnBehavior: true}),
924
- meta: {applyRedFix: true, enhancedHue: false},
886
+ extend: tuya.extend.light_onoff_brightness_colortemp_color({colorTempRange: [153, 500]}),
925
887
  },
926
888
  ];
@@ -112,27 +112,20 @@ module.exports = [
112
112
  model: 'QS-Zigbee-D02-TRIAC-LN',
113
113
  vendor: 'Lonsonho',
114
114
  description: '1 gang smart dimmer switch module with neutral',
115
- fromZigbee: extend.light_onoff_brightness({disableMoveStep: true, disableTransition: true})
116
- .fromZigbee.concat([fz.tuya_min_brightness]),
117
- toZigbee: extend.light_onoff_brightness({disableMoveStep: true, disableTransition: true})
118
- .toZigbee.concat([tz.tuya_min_brightness]),
119
- exposes: [e.light_brightness().withMinBrightness()],
115
+ extend: tuya.extend.light_onoff_brightness({disableMoveStep: true, disableTransition: true, minBrightness: true}),
120
116
  },
121
117
  {
122
118
  fingerprint: [{modelID: 'TS110F', manufacturerName: '_TYZB01_v8gtiaed'}],
123
119
  model: 'QS-Zigbee-D02-TRIAC-2C-LN',
124
120
  vendor: 'Lonsonho',
125
121
  description: '2 gang smart dimmer switch module with neutral',
126
- fromZigbee: extend.light_onoff_brightness().fromZigbee.concat([fz.tuya_min_brightness]),
127
- toZigbee: extend.light_onoff_brightness().toZigbee.concat([tz.tuya_min_brightness]),
128
- exposes: [e.light_brightness().withMinBrightness().withEndpoint('l1'),
129
- e.light_brightness().withMinBrightness().withEndpoint('l2')],
122
+ extend: tuya.extend.light_onoff_brightness({minBrightness: true, endpoints: ['l1', 'l2'], noConfigure: true}),
130
123
  endpoint: (device) => {
131
124
  return {'l1': 1, 'l2': 2};
132
125
  },
133
126
  meta: {multiEndpoint: true},
134
127
  configure: async (device, coordinatorEndpoint, logger) => {
135
- await extend.light_onoff_brightness().configure(device, coordinatorEndpoint, logger);
128
+ await tuya.extend.light_onoff_brightness().configure(device, coordinatorEndpoint, logger);
136
129
  await reporting.bind(device.getEndpoint(1), coordinatorEndpoint, ['genOnOff', 'genLevelCtrl']);
137
130
  await reporting.bind(device.getEndpoint(2), coordinatorEndpoint, ['genOnOff', 'genLevelCtrl']);
138
131
  // Don't do: await reporting.onOff(endpoint); https://github.com/Koenkk/zigbee2mqtt/issues/6041
@@ -3,7 +3,6 @@ const fz = require('../converters/fromZigbee');
3
3
  const tz = require('../converters/toZigbee');
4
4
  const reporting = require('../lib/reporting');
5
5
  const tuya = require('../lib/tuya');
6
- const extend = require('../lib/extend');
7
6
  const e = exposes.presets;
8
7
  const ea = exposes.access;
9
8
 
@@ -78,16 +77,14 @@ module.exports = [
78
77
  model: 'SMCL01-ZB',
79
78
  vendor: 'Mercator',
80
79
  description: 'Ikuü Ikon ceiling light CCT',
81
- extend: extend.light_onoff_brightness_colortemp({colorTempRange: [153, 500], disablePowerOnBehavior: true}),
80
+ extend: tuya.extend.light_onoff_brightness_colortemp({colorTempRange: [153, 500]}),
82
81
  },
83
82
  {
84
83
  fingerprint: [{modelID: 'TS0505B', manufacturerName: '_TZ3000_xr5m6kfg'}],
85
84
  model: 'SMD4109W-RGB-ZB',
86
85
  vendor: 'Mercator',
87
86
  description: 'Ikuü Walter downlight RGB + CCT',
88
- extend: extend.light_onoff_brightness_colortemp_color(
89
- {colorTempRange: [153, 500], disableColorTempStartup: true, disablePowerOnBehavior: true}),
90
- meta: {applyRedFix: true, enhancedHue: false},
87
+ extend: tuya.extend.light_onoff_brightness_colortemp_color({colorTempRange: [153, 500]}),
91
88
  },
92
89
  {
93
90
  fingerprint: [{modelID: 'TS011F', manufacturerName: '_TZ3210_raqjcxo5'}],
@@ -1,9 +1,6 @@
1
1
  const exposes = require('../lib/exposes');
2
2
  const fz = require('../converters/fromZigbee');
3
- const tz = require('../converters/toZigbee');
4
3
  const e = exposes.presets;
5
- const ea = exposes.access;
6
- const extend = require('../lib/extend');
7
4
  const tuya = require('../lib/tuya');
8
5
 
9
6
  module.exports = [
@@ -12,33 +9,14 @@ module.exports = [
12
9
  model: 'FUT066Z',
13
10
  vendor: 'MiBoxer',
14
11
  description: 'RGB+CCT LED Downlight',
15
- toZigbee: extend.light_onoff_brightness_colortemp_color().toZigbee.concat([
16
- tz.tuya_do_not_disturb, tz.tuya_color_power_on_behavior]),
17
- meta: {applyRedFix: true, enhancedHue: false},
18
- fromZigbee: extend.light_onoff_brightness_colortemp_color().fromZigbee,
19
- exposes: [e.light_brightness_colortemp_colorhs([153, 500]).removeFeature('color_temp_startup'),
20
- exposes.binary('do_not_disturb', ea.STATE_SET, true, false)
21
- .withDescription('Do not disturb mode'),
22
- exposes.enum('color_power_on_behavior', ea.STATE_SET, ['initial', 'previous', 'cutomized'])
23
- .withDescription('Power on behavior state'),
24
- ],
12
+ extend: tuya.extend.light_onoff_brightness_colortemp_color({colorTempRange: [153, 500]}),
25
13
  },
26
14
  {
27
15
  fingerprint: [{modelID: 'TS0505B', manufacturerName: '_TZ3210_jicmoite'}],
28
16
  model: 'FUT039Z',
29
17
  vendor: 'Miboxer',
30
18
  description: 'RGB+CCT LED controller',
31
- toZigbee: extend.light_onoff_brightness_colortemp_color().toZigbee.concat([
32
- tz.tuya_do_not_disturb, tz.tuya_color_power_on_behavior,
33
- ]),
34
- meta: {applyRedFix: true, enhancedHue: false},
35
- fromZigbee: extend.light_onoff_brightness_colortemp_color().fromZigbee,
36
- exposes: [e.light_brightness_colortemp_colorhs([153, 500]).removeFeature('color_temp_startup'),
37
- exposes.binary('do_not_disturb', ea.STATE_SET, true, false)
38
- .withDescription('Do not disturb mode'),
39
- exposes.enum('color_power_on_behavior', ea.STATE_SET, ['initial', 'previous', 'cutomized'])
40
- .withDescription('Power on behavior state'),
41
- ],
19
+ extend: tuya.extend.light_onoff_brightness_colortemp_color({colorTempRange: [153, 500]}),
42
20
  },
43
21
  {
44
22
  fingerprint: [{modelID: 'TS0501B', manufacturerName: '_TZ3210_dxroobu3'},
@@ -46,7 +24,7 @@ module.exports = [
46
24
  model: 'FUT036Z',
47
25
  description: 'Single color LED controller',
48
26
  vendor: 'Miboxer',
49
- extend: extend.light_onoff_brightness({disablePowerOnBehavior: true}),
27
+ extend: tuya.extend.light_onoff_brightness(),
50
28
  onEvent: tuya.onEventSetTime,
51
29
  },
52
30
  {
@@ -58,14 +36,14 @@ module.exports = [
58
36
  model: 'FUT035Z',
59
37
  description: 'Dual white LED controller',
60
38
  vendor: 'Miboxer',
61
- extend: extend.light_onoff_brightness_colortemp({disableColorTempStartup: true, colorTempRange: [153, 500]}),
39
+ extend: tuya.extend.light_onoff_brightness_colortemp({colorTempRange: [153, 500]}),
62
40
  },
63
41
  {
64
42
  fingerprint: [{modelID: 'TS0504B', manufacturerName: '_TZ3210_ttkgurpb'}],
65
43
  model: 'FUT038Z',
66
44
  description: 'RGBW LED controller',
67
45
  vendor: 'Miboxer',
68
- extend: extend.light_onoff_brightness_colortemp_color({disableColorTempStartup: true, colorTempRange: [153, 500]}),
46
+ extend: tuya.extend.light_onoff_brightness_colortemp_color({colorTempRange: [153, 500]}),
69
47
  },
70
48
  {
71
49
  fingerprint: [{modelID: 'TS1002', manufacturerName: '_TZ3000_xwh1e22x'}],
package/devices/moes.js CHANGED
@@ -338,18 +338,7 @@ module.exports = [
338
338
  model: 'ZLD-RCW',
339
339
  vendor: 'Moes',
340
340
  description: 'RGB+CCT Zigbee LED Controller',
341
- toZigbee: extend.light_onoff_brightness_colortemp_color().toZigbee.concat([
342
- tz.tuya_do_not_disturb, tz.tuya_color_power_on_behavior,
343
- ]),
344
- meta: {applyRedFix: true, enhancedHue: false},
345
- fromZigbee: extend.light_onoff_brightness_colortemp_color().fromZigbee,
346
- exposes: extend.light_onoff_brightness_colortemp_color({colorTempRange: [153, 500], disableColorTempStartup: true,
347
- disablePowerOnBehavior: true}).exposes.concat([
348
- exposes.binary('do_not_disturb', ea.STATE_SET, true, false)
349
- .withDescription('Do not disturb mode'),
350
- exposes.enum('color_power_on_behavior', ea.STATE_SET, ['initial', 'previous', 'cutomized'])
351
- .withDescription('Power on behavior state'),
352
- ]),
341
+ extend: tuya.extend.light_onoff_brightness_colortemp_color({colorTempRange: [153, 500]}),
353
342
  },
354
343
  {
355
344
  fingerprint: [{modelID: 'TS130F', manufacturerName: '_TZ3000_1dd0d5yi'}],
package/devices/mycket.js CHANGED
@@ -1,4 +1,4 @@
1
- const extend = require('../lib/extend');
1
+ const tuya = require('../lib/tuya');
2
2
 
3
3
  module.exports = [
4
4
  {
@@ -6,6 +6,6 @@ module.exports = [
6
6
  model: 'MS-SP-LE27WRGB',
7
7
  description: 'E27 RGBW bulb',
8
8
  vendor: 'Mycket',
9
- extend: extend.light_onoff_brightness_colortemp_color(),
9
+ extend: tuya.extend.light_onoff_brightness_colortemp_color(),
10
10
  },
11
11
  ];
@@ -3,6 +3,7 @@ const fz = {...require('../converters/fromZigbee'), legacy: require('../lib/lega
3
3
  const tz = require('../converters/toZigbee');
4
4
  const reporting = require('../lib/reporting');
5
5
  const extend = require('../lib/extend');
6
+ const tuya = require('../lib/tuya');
6
7
  const e = exposes.presets;
7
8
 
8
9
  module.exports = [
@@ -113,8 +114,8 @@ module.exports = [
113
114
  model: '404062',
114
115
  vendor: 'Müller Licht',
115
116
  description: 'Kea RGB+CCT',
116
- extend: extend.light_onoff_brightness_colortemp_color({colorTempRange: [153, 500]}),
117
- toZigbee: extend.light_onoff_brightness_colortemp_color().toZigbee.concat([tz.tint_scene]),
117
+ extend: tuya.extend.light_onoff_brightness_colortemp_color(
118
+ {colorTempRange: [153, 500], toZigbee: [tz.tint_scene, tuya.tz.do_not_disturb, tuya.tz.color_power_on_behavior]}),
118
119
  },
119
120
  {
120
121
  fingerprint: [{manufacturerName: '_TZ3000_bdbb0fon'}],
@@ -1,4 +1,4 @@
1
- const extend = require('../lib/extend');
1
+ const tuya = require('../lib/tuya');
2
2
 
3
3
  module.exports = [
4
4
  {
@@ -6,6 +6,6 @@ module.exports = [
6
6
  model: 'DL41-03-10-R-ZB',
7
7
  vendor: 'Oz Smart Things',
8
8
  description: 'Oz Smart RGBW Zigbee downlight 10w',
9
- extend: extend.light_onoff_brightness_colortemp_color({colorTempRange: [153, 500]}),
9
+ extend: tuya.extend.light_onoff_brightness_colortemp_color({colorTempRange: [153, 500]}),
10
10
  },
11
11
  ];
@@ -1,7 +1,7 @@
1
1
  const exposes = require('../lib/exposes');
2
2
  const fz = {...require('../converters/fromZigbee'), legacy: require('../lib/legacy').fromZigbee};
3
3
  const tz = require('../converters/toZigbee');
4
- const extend = require('../lib/extend');
4
+ const tuya = require('../lib/tuya');
5
5
  const reporting = require('../lib/reporting');
6
6
  const ea = exposes.access;
7
7
 
@@ -56,8 +56,7 @@ module.exports = [
56
56
  model: 'WZ5_rgb_1',
57
57
  vendor: 'TuYa',
58
58
  description: 'Zigbee & RF 5 in 1 LED controller (RGB mode)',
59
- extend: extend.light_onoff_brightness_color({supportsHS: true, preferHS: true, disableEffect: true}),
60
- meta: {applyRedFix: true, enhancedHue: false},
59
+ extend: tuya.extend.light_onoff_brightness_color({supportsHS: true, preferHS: true, disableEffect: true}),
61
60
  },
62
61
  {
63
62
  fingerprint: [
@@ -101,9 +100,9 @@ module.exports = [
101
100
  model: 'WZ1',
102
101
  vendor: 'Skydance',
103
102
  description: 'Zigbee & RF 2 channel LED controller',
104
- extend: extend.light_onoff_brightness({noConfigure: true, disableEffect: true}),
103
+ extend: tuya.extend.light_onoff_brightness({noConfigure: true}),
105
104
  configure: async (device, coordinatorEndpoint, logger) => {
106
- await extend.light_onoff_brightness().configure(device, coordinatorEndpoint, logger);
105
+ await tuya.extend.light_onoff_brightness().configure(device, coordinatorEndpoint, logger);
107
106
  const endpoint = device.getEndpoint(1);
108
107
  await reporting.bind(endpoint, coordinatorEndpoint, ['genOnOff', 'genLevelCtrl']);
109
108
  await reporting.onOff(endpoint);
package/devices/tuya.js CHANGED
@@ -845,13 +845,13 @@ module.exports = [
845
845
  e.pm25().withValueMin(0).withValueMax(999).withValueStep(1)],
846
846
  },
847
847
  {
848
- fingerprint: [{modelID: 'TS0601', manufacturerName: '_TZE200_ogkdpgy2'}],
848
+ fingerprint: tuya.fingerprint('TS0601', ['_TZE200_ogkdpgy2', '_TZE200_3ejwxpmu']),
849
849
  model: 'TS0601_co2_sensor',
850
850
  vendor: 'TuYa',
851
851
  description: 'NDIR co2 sensor',
852
852
  fromZigbee: [fz.tuya_air_quality],
853
853
  toZigbee: [],
854
- exposes: [e.co2()],
854
+ exposes: [e.temperature(), e.humidity(), e.co2()],
855
855
  },
856
856
  {
857
857
  fingerprint: [{modelID: 'TS0601', manufacturerName: '_TZE200_7bztmfm1'}],
@@ -988,7 +988,7 @@ module.exports = [
988
988
  model: 'CK-BL702-AL-01',
989
989
  vendor: 'TuYa',
990
990
  description: 'Zigbee LED bulb',
991
- extend: extend.light_onoff_brightness_colortemp_color({colorTempRange: [142, 500]}),
991
+ extend: tuya.extend.light_onoff_brightness_colortemp_color({colorTempRange: [142, 500]}),
992
992
  },
993
993
  {
994
994
  zigbeeModel: ['TS0505B'],
@@ -1002,9 +1002,7 @@ module.exports = [
1002
1002
  {vendor: 'Zemismart', model: 'LXZB-ZB-09A', description: 'Zemismart LED Surface Mounted Downlight 9W RGBW'},
1003
1003
  {vendor: 'Feconn', model: 'FE-GU10-5W', description: 'Zigbee GU10 5W smart bulb'},
1004
1004
  ],
1005
- extend: extend.light_onoff_brightness_colortemp_color(
1006
- {colorTempRange: [153, 500], disableColorTempStartup: true, disablePowerOnBehavior: true}),
1007
- meta: {applyRedFix: true, enhancedHue: false},
1005
+ extend: tuya.extend.light_onoff_brightness_colortemp_color({colorTempRange: [153, 500]}),
1008
1006
  },
1009
1007
  {
1010
1008
  zigbeeModel: ['TS0503B'],
@@ -1012,19 +1010,17 @@ module.exports = [
1012
1010
  vendor: 'TuYa',
1013
1011
  description: 'Zigbee RGB light',
1014
1012
  whiteLabel: [{vendor: 'BTF-Lighting', model: 'C03Z'}],
1015
- extend: extend.light_onoff_brightness_color({disablePowerOnBehavior: true}),
1016
- // Requires red fix: https://github.com/Koenkk/zigbee2mqtt/issues/5962#issue-796462106
1017
- meta: {applyRedFix: true, enhancedHue: false},
1013
+ extend: tuya.extend.light_onoff_brightness_color(),
1018
1014
  },
1019
1015
  {
1020
1016
  zigbeeModel: ['TS0504B'],
1021
1017
  model: 'TS0504B',
1022
1018
  vendor: 'TuYa',
1023
1019
  description: 'Zigbee RGBW light',
1024
- extend: extend.light_onoff_brightness_color({disablePowerOnBehavior: true}),
1020
+ extend: tuya.extend.light_onoff_brightness_color(),
1025
1021
  exposes: [e.light_brightness_color({disablePowerOnBehavior: true})
1026
1022
  .setAccess('color_xy', ea.STATE_SET).setAccess('color_hs', ea.STATE_SET)],
1027
- toZigbee: utils.replaceInArray(extend.light_onoff_brightness_color().toZigbee, [tz.light_color], [tzLocal.TS0504B_color]),
1023
+ toZigbee: utils.replaceInArray(tuya.extend.light_onoff_brightness_color().toZigbee, [tz.light_color], [tzLocal.TS0504B_color]),
1028
1024
  meta: {applyRedFix: true},
1029
1025
  },
1030
1026
  {
@@ -1032,14 +1028,14 @@ module.exports = [
1032
1028
  model: 'TS0501A',
1033
1029
  description: 'Zigbee light',
1034
1030
  vendor: 'TuYa',
1035
- extend: extend.light_onoff_brightness({disablePowerOnBehavior: true}),
1031
+ extend: tuya.extend.light_onoff_brightness(),
1036
1032
  },
1037
1033
  {
1038
1034
  zigbeeModel: ['TS0501B'],
1039
1035
  model: 'TS0501B',
1040
1036
  description: 'Zigbee light',
1041
1037
  vendor: 'TuYa',
1042
- extend: extend.light_onoff_brightness({disablePowerOnBehavior: true}),
1038
+ extend: tuya.extend.light_onoff_brightness(),
1043
1039
  },
1044
1040
  {
1045
1041
  fingerprint: tuya.fingerprint('TS0202', ['_TYZB01_vwqnz1sn']),
@@ -1630,8 +1626,7 @@ module.exports = [
1630
1626
  model: 'TS0503A',
1631
1627
  vendor: 'TuYa',
1632
1628
  description: 'Led strip controller',
1633
- extend: extend.light_onoff_brightness_color({disablePowerOnBehavior: true}),
1634
- meta: {applyRedFix: true},
1629
+ extend: tuya.extend.light_onoff_brightness_color(),
1635
1630
  },
1636
1631
  {
1637
1632
  zigbeeModel: ['TS0503A'],
@@ -1647,7 +1642,7 @@ module.exports = [
1647
1642
  model: 'TS0502A',
1648
1643
  vendor: 'TuYa',
1649
1644
  description: 'Light controller',
1650
- extend: extend.light_onoff_brightness_colortemp({disablePowerOnBehavior: true}),
1645
+ extend: tuya.extend.light_onoff_brightness_colortemp(),
1651
1646
  },
1652
1647
  {
1653
1648
  zigbeeModel: ['TS0502B'],
@@ -1658,14 +1653,14 @@ module.exports = [
1658
1653
  {vendor: 'Mercator Ikuü', model: 'SMI7040', description: 'Ford Batten Light'},
1659
1654
  {vendor: 'Mercator Ikuü', model: 'SMD9300', description: 'Donovan Panel Light'},
1660
1655
  ],
1661
- extend: extend.light_onoff_brightness_colortemp({colorTempRange: [153, 500], disablePowerOnBehavior: true}),
1656
+ extend: tuya.extend.light_onoff_brightness_colortemp({colorTempRange: [153, 500]}),
1662
1657
  },
1663
1658
  {
1664
1659
  zigbeeModel: ['TS0504A'],
1665
1660
  model: 'TS0504A',
1666
1661
  vendor: 'TuYa',
1667
1662
  description: 'RGBW LED controller',
1668
- extend: extend.light_onoff_brightness_colortemp_color({disablePowerOnBehavior: true}),
1663
+ extend: tuya.extend.light_onoff_brightness_colortemp_color(),
1669
1664
  },
1670
1665
  {
1671
1666
  fingerprint: [{modelID: 'TS0505A', manufacturerName: '_TZ3000_sosdczdl'}],
@@ -1681,7 +1676,7 @@ module.exports = [
1681
1676
  model: 'TS0505A',
1682
1677
  vendor: 'TuYa',
1683
1678
  description: 'RGB+CCT light controller',
1684
- extend: extend.light_onoff_brightness_colortemp_color({disablePowerOnBehavior: true}),
1679
+ extend: tuya.extend.light_onoff_brightness_colortemp_color(),
1685
1680
  },
1686
1681
  {
1687
1682
  fingerprint: [{manufacturerName: '_TZ2000_a476raq2'}],
@@ -2806,10 +2801,7 @@ module.exports = [
2806
2801
  model: 'TS1101_dimmer_module_1ch',
2807
2802
  vendor: 'TuYa',
2808
2803
  description: 'Zigbee dimmer module 1 channel',
2809
- fromZigbee: extend.light_onoff_brightness().fromZigbee.concat([fz.tuya_min_brightness]),
2810
- toZigbee: extend.light_onoff_brightness().toZigbee.concat([tz.tuya_min_brightness]),
2811
- exposes: [e.light_brightness().withMinBrightness()],
2812
- extend: extend.light_onoff_brightness(),
2804
+ extend: tuya.extend.light_onoff_brightness({minBrightness: true}),
2813
2805
  },
2814
2806
  {
2815
2807
  fingerprint: [{modelID: 'TS1101', manufacturerName: '_TZ3000_7ysdnebc'}],
@@ -2817,17 +2809,14 @@ module.exports = [
2817
2809
  vendor: 'TuYa',
2818
2810
  description: 'Zigbee dimmer module 2 channel',
2819
2811
  whiteLabel: [{vendor: 'OXT', model: 'SWTZ25'}],
2820
- fromZigbee: extend.light_onoff_brightness().fromZigbee.concat([fz.tuya_min_brightness]),
2821
- toZigbee: extend.light_onoff_brightness().toZigbee.concat([tz.tuya_min_brightness]),
2822
- exposes: [e.light_brightness().withMinBrightness().withEndpoint('l1'),
2823
- e.light_brightness().withMinBrightness().withEndpoint('l2')],
2812
+ extend: tuya.extend.light_onoff_brightness({minBrightness: true, endpoints: ['l1', 'l2'], noConfigure: true}),
2824
2813
  endpoint: (device) => {
2825
2814
  return {'l1': 1, 'l2': 2};
2826
2815
  },
2827
2816
  meta: {multiEndpoint: true},
2828
2817
  configure: async (device, coordinatorEndpoint, logger) => {
2829
2818
  await tuya.configureMagicPacket(device, coordinatorEndpoint, logger);
2830
- await extend.light_onoff_brightness().configure(device, coordinatorEndpoint, logger);
2819
+ await tuya.extend.light_onoff_brightness().configure(device, coordinatorEndpoint, logger);
2831
2820
  await reporting.bind(device.getEndpoint(1), coordinatorEndpoint, ['genOnOff', 'genLevelCtrl']);
2832
2821
  await reporting.bind(device.getEndpoint(2), coordinatorEndpoint, ['genOnOff', 'genLevelCtrl']);
2833
2822
  },
@@ -2895,7 +2884,7 @@ module.exports = [
2895
2884
  model: 'TS0011',
2896
2885
  vendor: 'TuYa',
2897
2886
  description: 'Smart light switch - 1 gang',
2898
- extend: tuya.extend.switch(),
2887
+ extend: tuya.extend.switch({backlightModeOffNormalInverted: true}),
2899
2888
  whiteLabel: [
2900
2889
  {vendor: 'Vrey', model: 'VR-X712U-0013'},
2901
2890
  {vendor: 'TUYATEC', model: 'GDKES-01TZXD'},
@@ -1,4 +1,4 @@
1
- const extend = require('../lib/extend');
1
+ const tuya = require('../lib/tuya');
2
2
 
3
3
  module.exports = [
4
4
  {
@@ -7,6 +7,6 @@ module.exports = [
7
7
  vendor: 'UR Lighting',
8
8
  description: '10W RGB+CCT downlight',
9
9
  meta: {applyRedFix: true, enhancedHue: false},
10
- extend: extend.light_onoff_brightness_colortemp_color({colorTempRange: [153, 500]}),
10
+ extend: tuya.extend.light_onoff_brightness_colortemp_color({colorTempRange: [153, 500]}),
11
11
  },
12
12
  ];
package/devices/woox.js CHANGED
@@ -3,7 +3,6 @@ const reporting = require('../lib/reporting');
3
3
  const fz = {...require('../converters/fromZigbee'), legacy: require('../lib/legacy').fromZigbee};
4
4
  const tz = require('../converters/toZigbee');
5
5
  const tuya = require('../lib/tuya');
6
- const extend = require('../lib/extend');
7
6
  const e = exposes.presets;
8
7
  const ea = exposes.access;
9
8
 
@@ -114,7 +113,7 @@ module.exports = [
114
113
  model: 'R9077',
115
114
  vendor: 'Woox',
116
115
  description: 'RGB+CCT LED',
117
- extend: extend.light_onoff_brightness_colortemp_color({disableColorTempStartup: true}),
116
+ extend: tuya.extend.light_onoff_brightness_colortemp_color(),
118
117
  meta: {applyRedFix: true},
119
118
  },
120
119
  {
package/devices/xiaomi.js CHANGED
@@ -3094,4 +3094,38 @@ module.exports = [
3094
3094
  await endpoint.read('aqaraOpple', [0x148], {manufacturerCode: 0x115f, disableDefaultResponse: true, disableResponse: true});
3095
3095
  },
3096
3096
  },
3097
+ {
3098
+ zigbeeModel: ['lumi.switch.acn040'],
3099
+ model: 'ZNQBKG31LM',
3100
+ vendor: 'Xiaomi',
3101
+ description: 'Aqara E1 3 gang switch (with neutral)',
3102
+ fromZigbee: [fz.on_off, fz.xiaomi_multistate_action, fz.aqara_opple],
3103
+ toZigbee: [tz.on_off, tz.xiaomi_switch_operation_mode_opple, tz.xiaomi_switch_power_outage_memory, tz.aqara_switch_mode_switch,
3104
+ tz.xiaomi_flip_indicator_light],
3105
+ endpoint: (device) => {
3106
+ return {'left': 1, 'center': 2, 'right': 3};
3107
+ },
3108
+ meta: {multiEndpoint: true},
3109
+ exposes: [
3110
+ e.switch().withEndpoint('left'), e.switch().withEndpoint('center'), e.switch().withEndpoint('right'),
3111
+ exposes.enum('operation_mode', ea.ALL, ['control_relay', 'decoupled'])
3112
+ .withDescription('Decoupled mode for left button')
3113
+ .withEndpoint('left'),
3114
+ exposes.enum('operation_mode', ea.ALL, ['control_relay', 'decoupled'])
3115
+ .withDescription('Decoupled mode for center button')
3116
+ .withEndpoint('center'),
3117
+ exposes.enum('operation_mode', ea.ALL, ['control_relay', 'decoupled'])
3118
+ .withDescription('Decoupled mode for right button')
3119
+ .withEndpoint('right'),
3120
+ e.action(['single_left', 'double_left', 'single_center', 'double_center', 'single_right', 'double_right',
3121
+ 'single_left_center', 'double_left_center', 'single_left_right', 'double_left_right',
3122
+ 'single_center_right', 'double_center_right', 'single_all', 'double_all']),
3123
+ e.power_outage_memory(), e.device_temperature(), e.flip_indicator_light(),
3124
+ ],
3125
+ onEvent: preventReset,
3126
+ configure: async (device, coordinatorEndpoint, logger) => {
3127
+ await device.getEndpoint(1).write('aqaraOpple', {'mode': 1}, {manufacturerCode: 0x115f, disableResponse: true});
3128
+ },
3129
+ ota: ota.zigbeeOTA,
3130
+ },
3097
3131
  ];
package/lib/extend.js CHANGED
@@ -18,10 +18,13 @@ const extend = {
18
18
  return {exposes, fromZigbee, toZigbee};
19
19
  },
20
20
  light_onoff_brightness: (options={}) => {
21
- options = {disableEffect: false, disablePowerOnBehavior: false, disableMoveStep: false, disableTransition: false, ...options};
22
- const exposes = [e.light_brightness(), ...(!options.disableEffect ? [e.effect()] : [])];
23
- const fromZigbee = [fz.on_off, fz.brightness, fz.level_config, fz.ignore_basic_report];
24
- const toZigbee = [tz.light_onoff_brightness, tz.ignore_rate, tz.level_config,
21
+ options = {
22
+ disableEffect: false, disablePowerOnBehavior: false, disableMoveStep: false, disableTransition: false,
23
+ toZigbee: [], fromZigbee: [], exposes: [], ...options,
24
+ };
25
+ const exposes = [e.light_brightness(), ...(!options.disableEffect ? [e.effect()] : []), ...options.exposes];
26
+ const fromZigbee = [fz.on_off, fz.brightness, fz.level_config, fz.ignore_basic_report, ...options.fromZigbee];
27
+ const toZigbee = [tz.light_onoff_brightness, tz.ignore_rate, tz.level_config, ...options.toZigbee,
25
28
  ...(!options.disableTransition ? [tz.ignore_transition] : []),
26
29
  ...(!options.disableEffect ? [tz.effect] : []),
27
30
  ...(!options.disableMoveStep ? [tz.light_brightness_move, tz.light_brightness_step] : [])];
@@ -42,12 +45,17 @@ const extend = {
42
45
  return result;
43
46
  },
44
47
  light_onoff_brightness_colortemp: (options={}) => {
45
- options = {disableEffect: false, disableColorTempStartup: false, disablePowerOnBehavior: false, ...options};
46
- const exposes = [e.light_brightness_colortemp(options.colorTempRange), ...(!options.disableEffect ? [e.effect()] : [])];
48
+ options = {
49
+ disableEffect: false, disableColorTempStartup: false, disablePowerOnBehavior: false,
50
+ toZigbee: [], fromZigbee: [], exposes: [], ...options,
51
+ };
52
+ const exposes = [e.light_brightness_colortemp(options.colorTempRange), ...(!options.disableEffect ? [e.effect()] : []),
53
+ ...options.exposes];
47
54
  const toZigbee = [tz.light_onoff_brightness, tz.light_colortemp, tz.ignore_transition, tz.ignore_rate, tz.light_brightness_move,
48
55
  tz.light_colortemp_move, tz.light_brightness_step, tz.light_colortemp_step, tz.light_colortemp_startup, tz.level_config,
56
+ ...options.toZigbee,
49
57
  tz.light_color_options, tz.light_color_mode, ...(!options.disableEffect ? [tz.effect] : [])];
50
- const fromZigbee = [fz.color_colortemp, fz.on_off, fz.brightness, fz.level_config, fz.ignore_basic_report];
58
+ const fromZigbee = [fz.color_colortemp, fz.on_off, fz.brightness, fz.level_config, fz.ignore_basic_report, ...options.fromZigbee];
51
59
 
52
60
  if (options.disableColorTempStartup) {
53
61
  exposes[0].removeFeature('color_temp_startup');
@@ -70,12 +78,15 @@ const extend = {
70
78
  return result;
71
79
  },
72
80
  light_onoff_brightness_color: (options={}) => {
73
- options = {disableEffect: false, supportsHS: false, preferHS: false, disablePowerOnBehavior: false, ...options};
81
+ options = {
82
+ disableEffect: false, supportsHS: false, preferHS: false, disablePowerOnBehavior: false,
83
+ toZigbee: [], fromZigbee: [], exposes: [], ...options,
84
+ };
74
85
  const exposes = [(options.supportsHS ? e.light_brightness_color(options.preferHS) : e.light_brightness_colorxy()),
75
- ...(!options.disableEffect ? [e.effect()] : [])];
76
- const fromZigbee = [fz.color_colortemp, fz.on_off, fz.brightness, fz.level_config, fz.ignore_basic_report];
86
+ ...(!options.disableEffect ? [e.effect()] : []), ...options.exposes];
87
+ const fromZigbee = [fz.color_colortemp, fz.on_off, fz.brightness, fz.level_config, fz.ignore_basic_report, ...options.fromZigbee];
77
88
  const toZigbee = [tz.light_onoff_brightness, tz.light_color, tz.ignore_transition, tz.ignore_rate, tz.light_brightness_move,
78
- tz.light_brightness_step, tz.level_config, tz.light_hue_saturation_move,
89
+ tz.light_brightness_step, tz.level_config, tz.light_hue_saturation_move, ...options.toZigbee,
79
90
  tz.light_hue_saturation_step, tz.light_color_options, tz.light_color_mode, ...(!options.disableEffect ? [tz.effect] : [])];
80
91
 
81
92
  if (!options.disablePowerOnBehavior) {
@@ -95,20 +106,20 @@ const extend = {
95
106
  },
96
107
  light_onoff_brightness_colortemp_color: (options={}) => {
97
108
  options = {
98
- disableEffect: false,
99
- supportsHS: false,
100
- disableColorTempStartup: false,
101
- preferHS: false,
102
- disablePowerOnBehavior: false,
103
- ...options};
104
- const exposes = [(options.supportsHS ? e.light_brightness_colortemp_color(options.colorTempRange, options.preferHS) :
105
- e.light_brightness_colortemp_colorxy(options.colorTempRange)), ...(!options.disableEffect ? [e.effect()] : [])];
106
- const fromZigbee = [fz.color_colortemp, fz.on_off, fz.brightness, fz.level_config, fz.ignore_basic_report];
109
+ disableEffect: false, supportsHS: false, disableColorTempStartup: false, preferHS: false, disablePowerOnBehavior: false,
110
+ toZigbee: [], fromZigbee: [], exposes: [], ...options,
111
+ };
112
+ const exposes = [
113
+ (options.supportsHS ? e.light_brightness_colortemp_color(options.colorTempRange, options.preferHS) :
114
+ e.light_brightness_colortemp_colorxy(options.colorTempRange)), ...(!options.disableEffect ? [e.effect()] : []),
115
+ ...options.exposes,
116
+ ];
117
+ const fromZigbee = [fz.color_colortemp, fz.on_off, fz.brightness, fz.level_config, fz.ignore_basic_report, ...options.fromZigbee];
107
118
  const toZigbee = [
108
119
  tz.light_onoff_brightness, tz.light_color_colortemp, tz.ignore_transition, tz.ignore_rate, tz.light_brightness_move,
109
120
  tz.light_colortemp_move, tz.light_brightness_step, tz.light_colortemp_step, tz.light_hue_saturation_move,
110
121
  tz.light_hue_saturation_step, tz.light_colortemp_startup, tz.level_config, tz.light_color_options,
111
- tz.light_color_mode, ...(!options.disableEffect ? [tz.effect] : [])];
122
+ tz.light_color_mode, ...(!options.disableEffect ? [tz.effect] : []), ...options.toZigbee];
112
123
 
113
124
  if (options.disableColorTempStartup) {
114
125
  exposes[0].removeFeature('color_temp_startup');
package/lib/tuya.js CHANGED
@@ -1168,6 +1168,10 @@ const tuyaExposes = {
1168
1168
  powerOutageMemory: () => exposes.enum('power_outage_memory', ea.ALL, ['on', 'off', 'restore'])
1169
1169
  .withDescription('Recover state after power outage'),
1170
1170
  batteryState: () => exposes.enum('battery_state', ea.STATE, ['low', 'medium', 'high']).withDescription('State of the battery'),
1171
+ doNotDisturb: () => exposes.binary('do_not_disturb', ea.STATE_SET, true, false)
1172
+ .withDescription('Do not disturb mode, when enabled this function will keep the light OFF after a power outage'),
1173
+ colorPowerOnBehavior: () => exposes.enum('color_power_on_behavior', ea.STATE_SET, ['initial', 'previous', 'cutomized'])
1174
+ .withDescription('Power on behavior state'),
1171
1175
  };
1172
1176
 
1173
1177
  const skip = {
@@ -1576,6 +1580,30 @@ const tuyaTz = {
1576
1580
  await entity.write('genOnOff', {0x8000: {value: value === 'LOCK', type: 0x10}});
1577
1581
  },
1578
1582
  },
1583
+ min_brightness: {
1584
+ key: ['min_brightness'],
1585
+ convertSet: async (entity, key, value, meta) => {
1586
+ const minValueHex = value.toString(16);
1587
+ const maxValueHex = 'ff';
1588
+ const minMaxValue = parseInt(`${minValueHex}${maxValueHex}`, 16);
1589
+ const payload = {0xfc00: {value: minMaxValue, type: 0x21}};
1590
+ await entity.write('genLevelCtrl', payload, {disableDefaultResponse: true});
1591
+ return {state: {min_brightness: value}};
1592
+ },
1593
+ convertGet: async (entity, key, meta) => {
1594
+ await entity.read('genLevelCtrl', [0xfc00]);
1595
+ },
1596
+ },
1597
+ color_power_on_behavior: {
1598
+ key: ['color_power_on_behavior'],
1599
+ convertSet: async (entity, key, value, meta) => {
1600
+ const lookup = {'initial': 0, 'previous': 1, 'cutomized': 2};
1601
+ utils.validateValue(value, Object.keys(lookup));
1602
+ await entity.command('lightingColorCtrl', 'tuyaOnStartUp', {
1603
+ mode: lookup[value]*256, data: [0, 0, 0, 0, 0, 0, 0, 0, 0, 0]});
1604
+ return {state: {color_power_on_behavior: value}};
1605
+ },
1606
+ },
1579
1607
  datapoints: {
1580
1608
  key: [
1581
1609
  'temperature_unit', 'temperature_calibration', 'humidity_calibration', 'alarm_switch',
@@ -1623,6 +1651,13 @@ const tuyaTz = {
1623
1651
  return {state};
1624
1652
  },
1625
1653
  },
1654
+ do_not_disturb: {
1655
+ key: ['do_not_disturb'],
1656
+ convertSet: async (entity, key, value, meta) => {
1657
+ await entity.command('lightingColorCtrl', 'tuyaDoNotDisturb', {enable: value ? 1 : 0});
1658
+ return {state: {do_not_disturb: value}};
1659
+ },
1660
+ },
1626
1661
  };
1627
1662
 
1628
1663
  const tuyaFz = {
@@ -1715,6 +1750,17 @@ const tuyaFz = {
1715
1750
  }
1716
1751
  },
1717
1752
  },
1753
+ min_brightness: {
1754
+ cluster: 'genLevelCtrl',
1755
+ type: ['attributeReport', 'readResponse'],
1756
+ convert: (model, msg, publish, options, meta) => {
1757
+ if (msg.data.hasOwnProperty(0xfc00)) {
1758
+ const property = utils.postfixWithEndpointName('min_brightness', msg, model, meta);
1759
+ const value = parseInt(msg.data[0xfc00].toString(16).slice(0, 2), 16);
1760
+ return {[property]: value};
1761
+ }
1762
+ },
1763
+ },
1718
1764
  datapoints: {
1719
1765
  cluster: 'manuSpecificTuya',
1720
1766
  type: ['commandDataResponse', 'commandDataReport', 'commandActiveStatusReport', 'commandActiveStatusReportAlt'],
@@ -1810,6 +1856,50 @@ const tuyaExtend = {
1810
1856
  }
1811
1857
  return {exposes, fromZigbee, toZigbee};
1812
1858
  },
1859
+ light_onoff_brightness_colortemp_color: (options={}) => {
1860
+ const extend = require('./extend');
1861
+ options = {
1862
+ disableColorTempStartup: true, disablePowerOnBehavior: true, toZigbee: [tuyaTz.do_not_disturb, tuyaTz.color_power_on_behavior],
1863
+ exposes: [tuyaExposes.doNotDisturb(), tuyaExposes.colorPowerOnBehavior()], ...options,
1864
+ };
1865
+ const meta = {applyRedFix: true, enhancedHue: false};
1866
+ return {...extend.light_onoff_brightness_colortemp_color(options), meta};
1867
+ },
1868
+ light_onoff_brightness_colortemp: (options={}) => {
1869
+ const extend = require('./extend');
1870
+ options = {
1871
+ disableColorTempStartup: true, disablePowerOnBehavior: true, toZigbee: [tuyaTz.do_not_disturb],
1872
+ exposes: [tuyaExposes.doNotDisturb()], ...options,
1873
+ };
1874
+ return extend.light_onoff_brightness_colortemp(options);
1875
+ },
1876
+ light_onoff_brightness_color: (options={}) => {
1877
+ const extend = require('./extend');
1878
+ options = {
1879
+ disablePowerOnBehavior: true, toZigbee: [tuyaTz.do_not_disturb, tuyaTz.color_power_on_behavior],
1880
+ exposes: [tuyaExposes.doNotDisturb(), tuyaExposes.colorPowerOnBehavior()], ...options,
1881
+ };
1882
+ const meta = {applyRedFix: true, enhancedHue: false};
1883
+ return {...extend.light_onoff_brightness_color(options), meta};
1884
+ },
1885
+ light_onoff_brightness: (options={}) => {
1886
+ const extend = require('./extend');
1887
+ options = {
1888
+ disablePowerOnBehavior: true, toZigbee: [tuyaTz.do_not_disturb], exposes: [tuyaExposes.doNotDisturb()],
1889
+ minBrightness: false, ...options,
1890
+ };
1891
+ const result = extend.light_onoff_brightness(options);
1892
+ result.exposes = options.endpoints ? options.endpoints.map((ee) => e.light_brightness()) : [e.light_brightness()];
1893
+ if (options.minBrightness) {
1894
+ result.fromZigbee.push(tuyaFz.min_brightness);
1895
+ result.toZigbee.push(tuyaTz.min_brightness);
1896
+ result.exposes = result.exposes.map((e) => e.withMinBrightness());
1897
+ }
1898
+ if (options.endpoints) {
1899
+ result.exposes = result.exposes.map((e, i) => e.withEndpoint(options.endpoints[i]));
1900
+ }
1901
+ return result;
1902
+ },
1813
1903
  };
1814
1904
 
1815
1905
  module.exports = {
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "zigbee-herdsman-converters",
3
- "version": "15.0.41",
3
+ "version": "15.0.42",
4
4
  "description": "Collection of device converters to be used with zigbee-herdsman",
5
5
  "main": "index.js",
6
6
  "files": [
@@ -34,11 +34,11 @@
34
34
  },
35
35
  "homepage": "https://github.com/Koenkk/zigbee-herdsman-converters",
36
36
  "dependencies": {
37
- "axios": "^1.3.0",
37
+ "axios": "^1.3.2",
38
38
  "buffer-crc32": "^0.2.13",
39
39
  "https-proxy-agent": "^5.0.1",
40
40
  "tar-stream": "^3.0.0",
41
- "zigbee-herdsman": "^0.14.89"
41
+ "zigbee-herdsman": "^0.14.90"
42
42
  },
43
43
  "devDependencies": {
44
44
  "eslint": "*",