mirror of
https://github.com/Koenkk/zigbee2mqtt.git
synced 2026-07-02 01:51:38 +00:00
Update converters.
This commit is contained in:
@@ -686,7 +686,8 @@ const mapping = {
|
||||
'RADON TriTech ZB': [
|
||||
cfg.binary_sensor_occupancy, cfg.sensor_temperature, cfg.sensor_battery, cfg.binary_sensor_battery_low,
|
||||
],
|
||||
'IM-Z3.0-DIM': [cfg.light_brightness],
|
||||
'07005B': [cfg.light_brightness],
|
||||
'07004D': [cfg.light_brightness_colortemp_colorxy],
|
||||
'E1746': [],
|
||||
'LED1836G9': [cfg.light_brightness],
|
||||
'YRD426NRSC': [cfg.lock, cfg.sensor_battery],
|
||||
@@ -713,7 +714,7 @@ const mapping = {
|
||||
'316GLEDRF': [cfg.light_brightness],
|
||||
'LVS-ZB500D': [cfg.light_brightness],
|
||||
'ST218': [],
|
||||
'E1525': [cfg.binary_sensor_occupancy, cfg.sensor_battery],
|
||||
'E1525/E1745': [cfg.binary_sensor_occupancy, cfg.sensor_battery],
|
||||
'ZYCT-202': [cfg.sensor_action],
|
||||
'GR-ZB01-W': [cfg.cover_position],
|
||||
'4090531P7': [cfg.light_brightness_colortemp_colorxy],
|
||||
@@ -1021,7 +1022,7 @@ const mapping = {
|
||||
'TS0218': [cfg.sensor_action, cfg.sensor_battery],
|
||||
'404021': [cfg.switch],
|
||||
'Eco-Dim.07': [cfg.light_brightness],
|
||||
'DYRuZ_rspm': [cfg.switch, cfg.sensor_action, cfg.sensor_power, cfg.sensor_current],
|
||||
'DIYRuZ_rspm': [cfg.switch, cfg.sensor_action, cfg.sensor_power, cfg.sensor_current],
|
||||
'ZG9101SAC-HP-Switch': [cfg.switch],
|
||||
'ZNCZ04LM': [cfg.switch, cfg.sensor_power],
|
||||
'GL-S-007ZS': [cfg.light_brightness_colortemp_colorxy],
|
||||
@@ -1061,6 +1062,19 @@ const mapping = {
|
||||
'ZK-EU-2U': [cfg.switch],
|
||||
'511.202': [cfg.switch],
|
||||
'SP 224': [cfg.switch],
|
||||
'9290022411': [cfg.light_brightness],
|
||||
'E1C-NB6': [cfg.switch],
|
||||
'LVS-SC7': [cfg.sensor_action],
|
||||
'1742930P7': [cfg.light_brightness_colorxy],
|
||||
'ZM-L03E-Z': [switchWithPostfix('left'), switchWithPostfix('center'), switchWithPostfix('right')],
|
||||
'DL15S-1BZ': [cfg.switch],
|
||||
'E1D-G73WNA': [cfg.binary_sensor_contact, cfg.binary_sensor_battery_low],
|
||||
'WV704R0A0902': [cfg.thermostat()],
|
||||
'067776': [cfg.cover_position],
|
||||
'067773': [cfg.sensor_action, cfg.sensor_battery],
|
||||
'067771': [cfg.switch],
|
||||
'064873': [cfg.sensor_action],
|
||||
'K3004C': [cfg.switch],
|
||||
};
|
||||
|
||||
Object.keys(mapping).forEach((key) => {
|
||||
|
||||
Generated
+32
-32
@@ -477,20 +477,20 @@
|
||||
"dev": true
|
||||
},
|
||||
"@typescript-eslint/experimental-utils": {
|
||||
"version": "2.13.0",
|
||||
"resolved": "https://registry.npmjs.org/@typescript-eslint/experimental-utils/-/experimental-utils-2.13.0.tgz",
|
||||
"integrity": "sha512-+Hss3clwa6aNiC8ZjA45wEm4FutDV5HsVXPl/rDug1THq6gEtOYRGLqS3JlTk7mSnL5TbJz0LpEbzbPnKvY6sw==",
|
||||
"version": "2.14.0",
|
||||
"resolved": "https://registry.npmjs.org/@typescript-eslint/experimental-utils/-/experimental-utils-2.14.0.tgz",
|
||||
"integrity": "sha512-KcyKS7G6IWnIgl3ZpyxyBCxhkBPV+0a5Jjy2g5HxlrbG2ZLQNFeneIBVXdaBCYOVjvGmGGFKom1kgiAY75SDeQ==",
|
||||
"dev": true,
|
||||
"requires": {
|
||||
"@types/json-schema": "^7.0.3",
|
||||
"@typescript-eslint/typescript-estree": "2.13.0",
|
||||
"@typescript-eslint/typescript-estree": "2.14.0",
|
||||
"eslint-scope": "^5.0.0"
|
||||
}
|
||||
},
|
||||
"@typescript-eslint/typescript-estree": {
|
||||
"version": "2.13.0",
|
||||
"resolved": "https://registry.npmjs.org/@typescript-eslint/typescript-estree/-/typescript-estree-2.13.0.tgz",
|
||||
"integrity": "sha512-t21Mg5cc8T3ADEUGwDisHLIubgXKjuNRbkpzDMLb7/JMmgCe/gHM9FaaujokLey+gwTuLF5ndSQ7/EfQqrQx4g==",
|
||||
"version": "2.14.0",
|
||||
"resolved": "https://registry.npmjs.org/@typescript-eslint/typescript-estree/-/typescript-estree-2.14.0.tgz",
|
||||
"integrity": "sha512-pnLpUcMNG7GfFFfNQbEX6f1aPa5fMnH2G9By+A1yovYI4VIOK2DzkaRuUlIkbagpAcrxQHLqovI1YWqEcXyRnA==",
|
||||
"dev": true,
|
||||
"requires": {
|
||||
"debug": "^4.1.1",
|
||||
@@ -1585,9 +1585,9 @@
|
||||
"dev": true
|
||||
},
|
||||
"escodegen": {
|
||||
"version": "1.12.0",
|
||||
"resolved": "https://registry.npmjs.org/escodegen/-/escodegen-1.12.0.tgz",
|
||||
"integrity": "sha512-TuA+EhsanGcme5T3R0L80u4t8CpbXQjegRmf7+FPTJrtCTErXFeelblRgHQa1FofEzqYYJmJ/OqjTwREp9qgmg==",
|
||||
"version": "1.12.1",
|
||||
"resolved": "https://registry.npmjs.org/escodegen/-/escodegen-1.12.1.tgz",
|
||||
"integrity": "sha512-Q8t2YZ+0e0pc7NRVj3B4tSQ9rim1oi4Fh46k2xhJ2qOiEwhQfdjyEQddWdj7ZFaKmU+5104vn1qrcjEPWq+bgQ==",
|
||||
"dev": true,
|
||||
"requires": {
|
||||
"esprima": "^3.1.3",
|
||||
@@ -1683,9 +1683,9 @@
|
||||
"dev": true
|
||||
},
|
||||
"eslint-plugin-jest": {
|
||||
"version": "23.1.1",
|
||||
"resolved": "https://registry.npmjs.org/eslint-plugin-jest/-/eslint-plugin-jest-23.1.1.tgz",
|
||||
"integrity": "sha512-2oPxHKNh4j1zmJ6GaCBuGcb8FVZU7YjFUOJzGOPnl9ic7VA/MGAskArLJiRIlnFUmi1EUxY+UiATAy8dv8s5JA==",
|
||||
"version": "23.2.0",
|
||||
"resolved": "https://registry.npmjs.org/eslint-plugin-jest/-/eslint-plugin-jest-23.2.0.tgz",
|
||||
"integrity": "sha512-/jbCUW+g0jejXAvsytgcNhii6uEgolt0RO2e4+mhmXybfkcram5V3XIyrHCnUsb0vCmDKgHhJ1lYSm7F3VCEDA==",
|
||||
"dev": true,
|
||||
"requires": {
|
||||
"@typescript-eslint/experimental-utils": "^2.5.0"
|
||||
@@ -4530,9 +4530,9 @@
|
||||
"dev": true
|
||||
},
|
||||
"p-limit": {
|
||||
"version": "2.2.1",
|
||||
"resolved": "https://registry.npmjs.org/p-limit/-/p-limit-2.2.1.tgz",
|
||||
"integrity": "sha512-85Tk+90UCVWvbDavCLKPOLC9vvY8OwEX/RtKF+/1OADJMVlFfEHOiMTPVyxg7mk/dKa+ipdHm0OUkTvCpMTuwg==",
|
||||
"version": "2.2.2",
|
||||
"resolved": "https://registry.npmjs.org/p-limit/-/p-limit-2.2.2.tgz",
|
||||
"integrity": "sha512-WGR+xHecKTr7EbUEhyLSh5Dube9JtdiG78ufaeLxTgpudf/20KqyMioIUZJAezlTIi6evxuoUs9YXc11cU+yzQ==",
|
||||
"dev": true,
|
||||
"requires": {
|
||||
"p-try": "^2.0.0"
|
||||
@@ -4717,9 +4717,9 @@
|
||||
}
|
||||
},
|
||||
"psl": {
|
||||
"version": "1.6.0",
|
||||
"resolved": "https://registry.npmjs.org/psl/-/psl-1.6.0.tgz",
|
||||
"integrity": "sha512-SYKKmVel98NCOYXpkwUqZqh0ahZeeKfmisiLIcEZdsb+WbLv02g/dI5BUmZnIyOe7RzZtLax81nnb2HbvC2tzA==",
|
||||
"version": "1.7.0",
|
||||
"resolved": "https://registry.npmjs.org/psl/-/psl-1.7.0.tgz",
|
||||
"integrity": "sha512-5NsSEDv8zY70ScRnOTn7bK7eanl2MvFrOrS/R6x+dBt5g1ghnj9Zv90kO8GwT8gxcu2ANyFprnFYB85IogIJOQ==",
|
||||
"dev": true
|
||||
},
|
||||
"pump": {
|
||||
@@ -5007,9 +5007,9 @@
|
||||
}
|
||||
},
|
||||
"rxjs": {
|
||||
"version": "6.5.3",
|
||||
"resolved": "https://registry.npmjs.org/rxjs/-/rxjs-6.5.3.tgz",
|
||||
"integrity": "sha512-wuYsAYYFdWTAnAaPoKGNhfpWwKZbJW+HgAJ+mImp+Epl7BG8oNWBCTyRM8gba9k4lk8BgWdoYm21Mo/RYhhbgA==",
|
||||
"version": "6.5.4",
|
||||
"resolved": "https://registry.npmjs.org/rxjs/-/rxjs-6.5.4.tgz",
|
||||
"integrity": "sha512-naMQXcgEo3csAEGvw/NydRA0fuS2nDZJiw1YUWFKU7aPPAPGZEsD4Iimit96qwCieH6y614MCLYwdkrWx7z/7Q==",
|
||||
"dev": true,
|
||||
"requires": {
|
||||
"tslib": "^1.9.0"
|
||||
@@ -5293,12 +5293,12 @@
|
||||
"dev": true
|
||||
},
|
||||
"source-map-resolve": {
|
||||
"version": "0.5.2",
|
||||
"resolved": "https://registry.npmjs.org/source-map-resolve/-/source-map-resolve-0.5.2.tgz",
|
||||
"integrity": "sha512-MjqsvNwyz1s0k81Goz/9vRBe9SZdB09Bdw+/zYyO+3CuPk6fouTaxscHkgtE8jKvf01kVfl8riHzERQ/kefaSA==",
|
||||
"version": "0.5.3",
|
||||
"resolved": "https://registry.npmjs.org/source-map-resolve/-/source-map-resolve-0.5.3.tgz",
|
||||
"integrity": "sha512-Htz+RnsXWk5+P2slx5Jh3Q66vhQj1Cllm0zvnaY98+NFx+Dv2CF/f5O/t8x+KaNdrdIAsruNzoh/KpialbqAnw==",
|
||||
"dev": true,
|
||||
"requires": {
|
||||
"atob": "^2.1.1",
|
||||
"atob": "^2.1.2",
|
||||
"decode-uri-component": "^0.2.0",
|
||||
"resolve-url": "^0.2.1",
|
||||
"source-map-url": "^0.4.0",
|
||||
@@ -5827,9 +5827,9 @@
|
||||
"integrity": "sha1-hnrHTjhkGHsdPUfZlqeOxciDB3c="
|
||||
},
|
||||
"uglify-js": {
|
||||
"version": "3.7.2",
|
||||
"resolved": "https://registry.npmjs.org/uglify-js/-/uglify-js-3.7.2.tgz",
|
||||
"integrity": "sha512-uhRwZcANNWVLrxLfNFEdltoPNhECUR3lc+UdJoG9CBpMcSnKyWA94tc3eAujB1GcMY5Uwq8ZMp4qWpxWYDQmaA==",
|
||||
"version": "3.7.3",
|
||||
"resolved": "https://registry.npmjs.org/uglify-js/-/uglify-js-3.7.3.tgz",
|
||||
"integrity": "sha512-7tINm46/3puUA4hCkKYo4Xdts+JDaVC9ZPRcG8Xw9R4nhO/gZgUM3TENq8IF4Vatk8qCig4MzP/c8G4u2BkVQg==",
|
||||
"dev": true,
|
||||
"optional": true,
|
||||
"requires": {
|
||||
@@ -12803,9 +12803,9 @@
|
||||
}
|
||||
},
|
||||
"zigbee-herdsman-converters": {
|
||||
"version": "11.1.64",
|
||||
"resolved": "https://registry.npmjs.org/zigbee-herdsman-converters/-/zigbee-herdsman-converters-11.1.64.tgz",
|
||||
"integrity": "sha512-EuJ/lUwvlttcxFvTo2n6LRekKq+0vjHyZU2O4CrECDI17VfL07IpjQgnW+gnP2CZUeuIU9osVmtndpacIV/wWQ==",
|
||||
"version": "11.1.65",
|
||||
"resolved": "https://registry.npmjs.org/zigbee-herdsman-converters/-/zigbee-herdsman-converters-11.1.65.tgz",
|
||||
"integrity": "sha512-zTOOKpupKGSRRJvWAG5l/YvaMpUXYs4f1rh/RjQD0FuNtzPbj5fOM5PfdDjijno516YnT9NC8EVKimxf9UufKA==",
|
||||
"dependencies": {
|
||||
"@babel/code-frame": {
|
||||
"version": "7.5.5",
|
||||
|
||||
+1
-1
@@ -46,7 +46,7 @@
|
||||
"semver": "*",
|
||||
"winston": "*",
|
||||
"zigbee-herdsman": "0.12.26",
|
||||
"zigbee-herdsman-converters": "11.1.64"
|
||||
"zigbee-herdsman-converters": "11.1.65"
|
||||
},
|
||||
"devDependencies": {
|
||||
"eslint": "*",
|
||||
|
||||
@@ -662,14 +662,16 @@ describe('Entity publish', () => {
|
||||
});
|
||||
|
||||
it('Should allow to set color via hue and saturation', async () => {
|
||||
const device = zigbeeHerdsman.devices.bulb_color_2;
|
||||
const device = zigbeeHerdsman.devices.bulb_color;
|
||||
const endpoint = device.getEndpoint(1);
|
||||
const payload = {"color":{"hue":250, "saturation":50}};
|
||||
await MQTT.events.message('zigbee2mqtt/bulb_color_2/set', JSON.stringify(payload));
|
||||
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(["lightingColorCtrl", "enhancedMoveToHueAndSaturation", {"direction": 0, "enhancehue": 45510.416666666664, "saturation": 127, "transtime": 0,}, {}]);
|
||||
expect(MQTT.publish).toHaveBeenCalledTimes(0);
|
||||
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({"color":{"hue":250,"saturation":50}});
|
||||
});
|
||||
|
||||
it('ZNCLDJ11LM open', async () => {
|
||||
|
||||
Reference in New Issue
Block a user