zigbee-herdsman-converters 14.0.394 → 14.0.395

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.
@@ -332,4 +332,25 @@ module.exports = [
332
332
  },
333
333
  exposes: [e.soil_moisture(), e.battery(), e.illuminance(), e.temperature(), e.humidity()],
334
334
  },
335
+ {
336
+ zigbeeModel: ['EFEKTA_PWS_MaxPro'],
337
+ model: 'EFEKTA_PWS_MaxPro',
338
+ vendor: 'Custom devices (DiY)',
339
+ description: '[Plant watering sensor EFEKTA PWS Max Pro, long battery life](http://efektalab.com/PWS_MaxPro)',
340
+ fromZigbee: [fz.temperature, fz.humidity, fz.illuminance, fz.soil_moisture, fz.battery],
341
+ toZigbee: [tz.factory_reset],
342
+ configure: async (device, coordinatorEndpoint, logger) => {
343
+ const firstEndpoint = device.getEndpoint(1);
344
+ await reporting.bind(firstEndpoint, coordinatorEndpoint, [
345
+ 'genPowerCfg', 'msTemperatureMeasurement', 'msRelativeHumidity', 'msIlluminanceMeasurement', 'msSoilMoisture']);
346
+ const overides = {min: 0, max: 21600, change: 0};
347
+ await reporting.batteryVoltage(firstEndpoint, overides);
348
+ await reporting.batteryPercentageRemaining(firstEndpoint, overides);
349
+ await reporting.temperature(firstEndpoint, overides);
350
+ await reporting.humidity(firstEndpoint, overides);
351
+ await reporting.illuminance(firstEndpoint, overides);
352
+ await reporting.soil_moisture(firstEndpoint, overides);
353
+ },
354
+ exposes: [e.soil_moisture(), e.battery(), e.illuminance(), e.temperature(), e.humidity()],
355
+ },
335
356
  ];
@@ -1021,7 +1021,7 @@ module.exports = [
1021
1021
  ota: ota.zigbeeOTA,
1022
1022
  },
1023
1023
  {
1024
- zigbeeModel: ['3417931P6'],
1024
+ zigbeeModel: ['3417931P6', '929003056201'],
1025
1025
  model: '3417931P6',
1026
1026
  vendor: 'Philips',
1027
1027
  description: 'Hue white ambiance Adore GU10 with Bluetooth (2 spots)',
@@ -1,5 +1,5 @@
1
- const reporting = require('zigbee-herdsman-converters/lib/reporting');
2
- const extend = require('zigbee-herdsman-converters/lib/extend');
1
+ const reporting = require('../lib/reporting');
2
+ const extend = require('../lib/extend');
3
3
 
4
4
  module.exports = [
5
5
  {
@@ -46,7 +46,7 @@ module.exports = [
46
46
  toZigbee: [tz.tuya_dimmer_state, tz.tuya_light_wz5],
47
47
  exposes: [
48
48
  exposes.light().withBrightness().setAccess('state', ea.STATE_SET).setAccess('brightness',
49
- ea.STATE_SET).withColor('hs'),
49
+ ea.STATE_SET).withColor(['hs']),
50
50
  ],
51
51
  },
52
52
  {
@@ -61,7 +61,7 @@ module.exports = [
61
61
  toZigbee: [tz.tuya_dimmer_state, tz.tuya_light_wz5],
62
62
  exposes: [
63
63
  exposes.light().withBrightness().setAccess('state', ea.STATE_SET).setAccess('brightness',
64
- ea.STATE_SET).withColor('hs'),
64
+ ea.STATE_SET).withColor(['hs']),
65
65
  exposes.numeric('white_brightness', ea.STATE_SET).withValueMin(0).withValueMax(254).withDescription(
66
66
  'White brightness of this light'),
67
67
  ],
@@ -79,7 +79,7 @@ module.exports = [
79
79
  toZigbee: [tz.tuya_dimmer_state, tz.tuya_light_wz5],
80
80
  exposes: [
81
81
  exposes.light().withBrightness().setAccess('state', ea.STATE_SET).setAccess('brightness',
82
- ea.STATE_SET).withColor('hs').withColorTemp([250, 454]).setAccess('color_temp',
82
+ ea.STATE_SET).withColor(['hs']).withColorTemp([250, 454]).setAccess('color_temp',
83
83
  ea.STATE_SET),
84
84
  exposes.numeric('white_brightness', ea.STATE_SET).withValueMin(0).withValueMax(254).withDescription(
85
85
  'White brightness of this light'),
package/devices/tuya.js CHANGED
@@ -510,6 +510,7 @@ module.exports = [
510
510
  {modelID: 'TS0502B', manufacturerName: '_TZ3000_zw7wr5uo'},
511
511
  {modelID: 'TS0502B', manufacturerName: '_TZ3210_pz9zmxjj'},
512
512
  {modelID: 'TS0502B', manufacturerName: '_TZ3000_fzwhym79'},
513
+ {modelID: 'TS0502B', manufacturerName: '_TZ3210_rm0hthdo'},
513
514
  ],
514
515
  model: 'TS0502B',
515
516
  vendor: 'TuYa',
@@ -1678,7 +1679,7 @@ module.exports = [
1678
1679
  await reporting.bind(endpoint, coordinatorEndpoint, ['genBasic']);
1679
1680
  },
1680
1681
  exposes: [exposes.binary('trigger', ea.STATE_SET, true, false).withDescription('Trigger the door movement'),
1681
- e.action(), exposes.binary('garage_door_contact', ea.STATE, true, false)],
1682
+ e.action(['trigger']), exposes.binary('garage_door_contact', ea.STATE, true, false)],
1682
1683
  },
1683
1684
  {
1684
1685
  fingerprint: [{modelID: 'TS0201', manufacturerName: '_TZ3000_qaaysllp'}],
package/devices/xiaomi.js CHANGED
@@ -1655,6 +1655,7 @@ module.exports = [
1655
1655
  const payload = reporting.payload('presentValue', 10, constants.repInterval.HOUR, 5);
1656
1656
  await endpoint.configureReporting('genAnalogInput', payload);
1657
1657
  },
1658
+ ota: ota.zigbeeOTA,
1658
1659
  },
1659
1660
  {
1660
1661
  zigbeeModel: ['lumi.switch.b2nc01'],
package/lib/exposes.js CHANGED
@@ -294,20 +294,22 @@ class Light extends Base {
294
294
 
295
295
  withColor(types) {
296
296
  assert(!this.endpoint, 'Cannot add feature after adding endpoint');
297
- if (types.includes('xy')) {
298
- const colorXY = new Composite('color_xy', 'color')
299
- .withFeature(new Numeric('x', access.ALL))
300
- .withFeature(new Numeric('y', access.ALL))
301
- .withDescription('Color of this light in the CIE 1931 color space (x/y)');
302
- this.features.push(colorXY);
303
- }
304
-
305
- if (types.includes('hs')) {
306
- const colorHS = new Composite('color_hs', 'color')
307
- .withFeature(new Numeric('hue', access.ALL))
308
- .withFeature(new Numeric('saturation', access.ALL))
309
- .withDescription('Color of this light expressed as hue/saturation');
310
- this.features.push(colorHS);
297
+ for (const type of types) {
298
+ if (type === 'xy') {
299
+ const colorXY = new Composite('color_xy', 'color')
300
+ .withFeature(new Numeric('x', access.ALL))
301
+ .withFeature(new Numeric('y', access.ALL))
302
+ .withDescription('Color of this light in the CIE 1931 color space (x/y)');
303
+ this.features.push(colorXY);
304
+ } else if (type === 'hs') {
305
+ const colorHS = new Composite('color_hs', 'color')
306
+ .withFeature(new Numeric('hue', access.ALL))
307
+ .withFeature(new Numeric('saturation', access.ALL))
308
+ .withDescription('Color of this light expressed as hue/saturation');
309
+ this.features.push(colorHS);
310
+ } else {
311
+ assert(false, `Unsupported color type ${type}`);
312
+ }
311
313
  }
312
314
 
313
315
  return this;
@@ -547,10 +549,10 @@ module.exports = {
547
549
  keypad_lockout: () => new Enum('keypad_lockout', access.ALL, ['unlock', 'lock1', 'lock2']).withDescription('Enables/disables physical input on the device'),
548
550
  led_disabled_night: () => new Binary('led_disabled_night', access.ALL, true, false).withDescription('Enable/disable the LED at night'),
549
551
  light_brightness: () => new Light().withBrightness(),
550
- light_brightness_color: () => new Light().withBrightness().withColor((['xy', 'hs'])),
552
+ light_brightness_color: (preferHS) => new Light().withBrightness().withColor((preferHS ? ['hs', 'xy'] : ['xy', 'hs'])),
551
553
  light_brightness_colorhs: () => new Light().withBrightness().withColor(['hs']),
552
554
  light_brightness_colortemp: (colorTempRange) => new Light().withBrightness().withColorTemp(colorTempRange).withColorTempStartup(colorTempRange),
553
- light_brightness_colortemp_color: (colorTempRange) => new Light().withBrightness().withColorTemp(colorTempRange).withColorTempStartup(colorTempRange).withColor(['xy', 'hs']),
555
+ light_brightness_colortemp_color: (colorTempRange, preferHS) => new Light().withBrightness().withColorTemp(colorTempRange).withColorTempStartup(colorTempRange).withColor(preferHS ? ['hs', 'xy'] : ['xy', 'hs']),
554
556
  light_brightness_colortemp_colorhs: (colorTempRange) => new Light().withBrightness().withColorTemp(colorTempRange).withColorTempStartup(colorTempRange).withColor(['hs']),
555
557
  light_brightness_colortemp_colorxy: (colorTempRange) => new Light().withBrightness().withColorTemp(colorTempRange).withColorTempStartup(colorTempRange).withColor(['xy']),
556
558
  light_brightness_colorxy: () => new Light().withBrightness().withColor((['xy'])),
package/lib/extend.js CHANGED
@@ -50,8 +50,8 @@ const extend = {
50
50
  return result;
51
51
  },
52
52
  light_onoff_brightness_color: (options={}) => {
53
- options = {disableEffect: false, supportsHS: false, ...options};
54
- const exposes = [(options.supportsHS ? e.light_brightness_color() : e.light_brightness_colorxy()),
53
+ options = {disableEffect: false, supportsHS: false, preferHS: false, ...options};
54
+ const exposes = [(options.supportsHS ? e.light_brightness_color(options.preferHS) : e.light_brightness_colorxy()),
55
55
  ...(!options.disableEffect ? [e.effect()] : [])];
56
56
  const fromZigbee = [fz.color_colortemp, fz.on_off, fz.brightness, fz.level_config, fz.power_on_behavior, fz.ignore_basic_report];
57
57
  const toZigbee = [tz.light_onoff_brightness, tz.light_color, tz.ignore_transition, tz.ignore_rate, tz.light_brightness_move,
@@ -66,8 +66,8 @@ const extend = {
66
66
  };
67
67
  },
68
68
  light_onoff_brightness_colortemp_color: (options={}) => {
69
- options = {disableEffect: false, supportsHS: false, disableColorTempStartup: false, ...options};
70
- const exposes = [(options.supportsHS ? e.light_brightness_colortemp_color(options.colorTempRange) :
69
+ options = {disableEffect: false, supportsHS: false, disableColorTempStartup: false, preferHS: false, ...options};
70
+ const exposes = [(options.supportsHS ? e.light_brightness_colortemp_color(options.colorTempRange, options.preferHS) :
71
71
  e.light_brightness_colortemp_colorxy(options.colorTempRange)), ...(!options.disableEffect ? [e.effect()] : [])];
72
72
  const fromZigbee = [fz.color_colortemp, fz.on_off, fz.brightness, fz.level_config, fz.power_on_behavior, fz.ignore_basic_report];
73
73
  const toZigbee = [
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "zigbee-herdsman-converters",
3
- "version": "14.0.394",
3
+ "version": "14.0.395",
4
4
  "lockfileVersion": 1,
5
5
  "requires": true,
6
6
  "dependencies": {
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "zigbee-herdsman-converters",
3
- "version": "14.0.394",
3
+ "version": "14.0.395",
4
4
  "description": "Collection of device converters to be used with zigbee-herdsman",
5
5
  "main": "index.js",
6
6
  "files": [