zigbee-herdsman-converters 21.11.0 → 21.12.0

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.
@@ -1 +1 @@
1
- {"version":3,"file":"toZigbee.d.ts","sourceRoot":"","sources":["../../src/converters/toZigbee.ts"],"names":[],"mappings":"AAIA,OAAO,KAAK,OAAO,MAAM,gBAAgB,CAAC;AAK1C,OAAO,EAAW,WAAW,EAAE,EAAE,EAAC,MAAM,cAAc,CAAC;AAk5IvD,QAAA,MAAM,UAAU;;QAlKR;;;WAGG;;;;mBAtmG8B,WAAW;;;;;;;;mBAAX,WAAW;;;;;;;;;;;;;;;;;;;;;;;;;;;mBAAX,WAAW;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;mBAAX,WAAW;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;mBAAX,WAAW;;;;;;;;;;;;;;QA4C5C;;;;;;;;;;;WAWG;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;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;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;mKA8vEoC,WAAW;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;CAg9BS,CAAC;AAEpE,eAAe,UAAU,CAAC"}
@@ -344,8 +344,20 @@ const converters2 = {
344
344
  lock: {
345
345
  key: ['state'],
346
346
  convertSet: async (entity, key, value, meta) => {
347
- utils.assertString(value, key);
348
- await entity.command('closuresDoorLock', `${value.toLowerCase()}Door`, { pincodevalue: '' }, utils.getOptions(meta.mapped, entity));
347
+ // If no pin code is provided, value is a only string. Ex: "UNLOCK"
348
+ let state = utils.isString(value) ? value.toUpperCase() : null;
349
+ let pincode = '';
350
+ // If pin code is provided, value is an object including new state and code. Ex: {state: "UNLOCK", code: "1234"}
351
+ if (utils.isObject(value)) {
352
+ if (value.code) {
353
+ pincode = utils.isString(value.code) ? value.code : '';
354
+ }
355
+ if (value.state) {
356
+ state = utils.isString(value.state) ? value.state.toUpperCase() : null;
357
+ }
358
+ }
359
+ utils.validateValue(state, ['LOCK', 'UNLOCK', 'TOGGLE']);
360
+ await entity.command('closuresDoorLock', `${state.toLowerCase()}Door`, { pincodevalue: pincode }, utils.getOptions(meta.mapped, entity));
349
361
  },
350
362
  convertGet: async (entity, key, meta) => {
351
363
  await entity.read('closuresDoorLock', ['lockState']);