diff --git a/lib/extension/homeassistant.js b/lib/extension/homeassistant.js index b97a25b10..352cc3391 100644 --- a/lib/extension/homeassistant.js +++ b/lib/extension/homeassistant.js @@ -956,6 +956,8 @@ const mapping = { '8718699688882': [cfg.light_brightness], 'LED1738G7': [cfg.light_brightness_colortemp], '9290022169': [cfg.light_brightness_colortemp], + 'TERNCY-PP01': [cfg.sensor_temperature, cfg.binary_sensor_occupancy, cfg.sensor_illuminance, cfg.sensor_click], + 'CR11S8UZ': [cfg.sensor_action], }; Object.keys(mapping).forEach((key) => { diff --git a/npm-shrinkwrap.json b/npm-shrinkwrap.json index a2f9f3d7e..f31960954 100644 --- a/npm-shrinkwrap.json +++ b/npm-shrinkwrap.json @@ -12637,9 +12637,9 @@ } }, "zigbee-herdsman-converters": { - "version": "11.1.36", - "resolved": "https://registry.npmjs.org/zigbee-herdsman-converters/-/zigbee-herdsman-converters-11.1.36.tgz", - "integrity": "sha512-LkjZmWSLEKCb0L7kvcJkPv6/50u/Qnb937LHRO51rYERidO/S8Gx4wrEat2mdT3okyxn31+Tk7QlKUdIPEMu5A==" + "version": "11.1.38", + "resolved": "https://registry.npmjs.org/zigbee-herdsman-converters/-/zigbee-herdsman-converters-11.1.38.tgz", + "integrity": "sha512-gDDxPMxNtN0fVY7AQasXx3eZLEluGvLLx/4yV7Ph4CJ9KgEBG4gi93rRPgVViTD737y6GhqApgWuQDKlzH2tFw==" } } } diff --git a/package.json b/package.json index 8dd59ecea..582570dc7 100644 --- a/package.json +++ b/package.json @@ -46,7 +46,7 @@ "semver": "*", "winston": "*", "zigbee-herdsman": "0.11.6", - "zigbee-herdsman-converters": "11.1.36" + "zigbee-herdsman-converters": "11.1.38" }, "devDependencies": { "eslint": "*", diff --git a/test/controller.test.js b/test/controller.test.js index 08ca05401..7e7d075ce 100644 --- a/test/controller.test.js +++ b/test/controller.test.js @@ -31,7 +31,7 @@ describe('Controller', () => { it('Start controller', async () => { await controller.start(); expect(logger.cleanup).toHaveBeenCalledTimes(1); - expect(zigbeeHerdsman.constructor).toHaveBeenCalledWith({"network":{"panID":6754,"extenedPanID":[221,221,221,221,221,221,221,221],"channelList":[11],"networkKey":[1,3,5,7,9,11,13,15,0,2,4,6,8,10,12,13]},"databasePath":path.join(data.mockDir, "database.db"),"backupPath":path.join(data.mockDir, "coordinator_backup.json"),"acceptJoiningDeviceHandler": expect.any(Function),"serialPort":{"baudRate":115200,"rtscts":true,"path":"/dev/dummy"}}); + expect(zigbeeHerdsman.constructor).toHaveBeenCalledWith({"network":{"panID":6754,"extenedPanID":[221,221,221,221,221,221,221,221],"channelList":[11],"networkKey":[1,3,5,7,9,11,13,15,0,2,4,6,8,10,12,13]},"databasePath":path.join(data.mockDir, "database.db"), "databaseBackupPath":path.join(data.mockDir, "database.db.backup"),"backupPath":path.join(data.mockDir, "coordinator_backup.json"),"acceptJoiningDeviceHandler": expect.any(Function),"serialPort":{"baudRate":115200,"rtscts":true,"path":"/dev/dummy"}}); expect(zigbeeHerdsman.start).toHaveBeenCalledTimes(1); expect(zigbeeHerdsman.setLED).toHaveBeenCalledTimes(0); expect(zigbeeHerdsman.permitJoin).toHaveBeenCalledTimes(1); diff --git a/test/entityPublish.test.js b/test/entityPublish.test.js index b174d1774..bdfdae0b1 100644 --- a/test/entityPublish.test.js +++ b/test/entityPublish.test.js @@ -677,17 +677,17 @@ describe('Entity publish', () => { expect(endpoint.command.mock.calls[0]).toEqual(["genOnOff", "on", {}, {}]); }); - it('Should turn device off when brightness 0 is send with light_brightness converter OFF', async () => { + it('Should turn device off with onOff on off with transition', async () => { const device = zigbeeHerdsman.devices.bulb_color; const endpoint = device.getEndpoint(1); const payload = {state: 'OFF', transition: 1}; await MQTT.events.message('zigbee2mqtt/bulb_color/set', JSON.stringify(payload)); await flushPromises(); expect(endpoint.command).toHaveBeenCalledTimes(1); - expect(endpoint.command.mock.calls[0]).toEqual(["genLevelCtrl", "moveToLevelWithOnOff", {level: 0, transtime: 10}, {}]); + expect(endpoint.command.mock.calls[0]).toEqual(["genOnOff", "off", {}, {}]); expect(MQTT.publish).toHaveBeenCalledTimes(1); expect(MQTT.publish.mock.calls[0][0]).toStrictEqual('zigbee2mqtt/bulb_color'); - expect(JSON.parse(MQTT.publish.mock.calls[0][1])).toStrictEqual({state: 'OFF', brightness: 0}); + expect(JSON.parse(MQTT.publish.mock.calls[0][1])).toStrictEqual({state: 'OFF'}); }); it('Home Assistant: should set state', async () => {