Update converters.

This commit is contained in:
Koen Kanters
2020-03-29 21:36:59 +02:00
parent 6b01418a00
commit 545eca6708
7 changed files with 42 additions and 8 deletions
+5 -2
View File
@@ -546,7 +546,7 @@ const cfg = {
},
};
},
'thermostat_heatcool': (minTemp=7, maxTemp=30, tempStep=0.5, fanModes=[]) => {
'thermostat_heatcool': /* istanbul ignore next */ (minTemp=7, maxTemp=30, tempStep=0.5, fanModes=[]) => {
return {
type: 'climate',
object_id: 'climate',
@@ -1339,7 +1339,7 @@ const mapping = {
switchWithPostfix('l1'), switchWithPostfix('l2'),
switchWithPostfix('l3'), switchWithPostfix('l4'),
],
'STS-WTR-250': [cfg.binary_sensor_water_leak, cfg.sensor_battery],
'STS-WTR-250': [cfg.binary_sensor_water_leak, cfg.sensor_battery, cfg.sensor_temperature],
'ZG2835RAC': [cfg.light_brightness],
'BW-IS2': [cfg.binary_sensor_contact, cfg.sensor_battery],
'BW-IS3': [cfg.binary_sensor_occupancy],
@@ -1441,6 +1441,9 @@ const mapping = {
'3157100': [cfg.thermostat_heatcool(10, 30, 1, ['auto', 'on']), cfg.sensor_battery],
'4257050-RZHAC': [cfg.switch, cfg.sensor_power],
'27087-03': [cfg.switch, cfg.sensor_battery],
'99140-002': [cfg.lock, cfg.sensor_battery],
'4512706': [cfg.sensor_battery, cfg.sensor_action],
'GL-S-004ZS': [cfg.light_brightness_colortemp_colorxy],
};
Object.keys(mapping).forEach((key) => {
+3 -3
View File
@@ -14783,9 +14783,9 @@
}
},
"zigbee-herdsman-converters": {
"version": "12.0.59",
"resolved": "https://registry.npmjs.org/zigbee-herdsman-converters/-/zigbee-herdsman-converters-12.0.59.tgz",
"integrity": "sha512-/iVSvHWtFkjQo8o+/UrZNu70/574egOusIZ3y29Lqi3dGWjeSiqHnRcULd9TwHFGkbQx46EZpG1h2KEeIjY1+g==",
"version": "12.0.60",
"resolved": "https://registry.npmjs.org/zigbee-herdsman-converters/-/zigbee-herdsman-converters-12.0.60.tgz",
"integrity": "sha512-23On3vFuIdJQLQgR4lCzqw2XVWp2sSKrnWSV9OCcj4/AZfTKrUmMQtRDUdrYl/S1F+6CNQRwVZx4/9FKoh53rg==",
"requires": {
"axios": "*",
"tar-stream": "*"
+1 -1
View File
@@ -46,7 +46,7 @@
"semver": "*",
"winston": "*",
"zigbee-herdsman": "0.12.69",
"zigbee-herdsman-converters": "12.0.59"
"zigbee-herdsman-converters": "12.0.60"
},
"devDependencies": {
"eslint": "*",
+2 -2
View File
@@ -176,8 +176,8 @@ describe('Bridge config', () => {
expect(MQTT.publish.mock.calls[0][0]).toStrictEqual('zigbee2mqtt/bridge/config/devices');
const payload = JSON.parse(MQTT.publish.mock.calls[0][1]);
expect(payload.length).toStrictEqual(Object.values(zigbeeHerdsman.devices).length);
expect(payload[0]).toStrictEqual({"ieeeAddr": "0x00124b00120144ae", "type": "Coordinator", "dateCode": "20190425", "friendly_name": "Coordinator", networkAddress: 0, softwareBuildID: "z-Stack", lastSeen: 100});
expect(payload[1]).toStrictEqual({"dateCode": null, "friendly_name": "bulb", "ieeeAddr": "0x000b57fffec6a5b2", "lastSeen": 1000, "manufacturerID": 4476, "model": "LED1545G12", "modelID": "TRADFRI bulb E27 WS opal 980lm", "networkAddress": 40369, "powerSource": "Mains (single phase)", "type": "Router", "description": "TRADFRI LED bulb E26/E27 980 lumen, dimmable, white spectrum, opal white", "vendor": "IKEA"});
expect(payload[1]).toStrictEqual({"ieeeAddr": "0x00124b00120144ae", "type": "Coordinator", "dateCode": "20190425", "friendly_name": "Coordinator", networkAddress: 0, softwareBuildID: "z-Stack", lastSeen: 100});
expect(payload[2]).toStrictEqual({"dateCode": null, "friendly_name": "bulb", "ieeeAddr": "0x000b57fffec6a5b2", "lastSeen": 1000, "manufacturerID": 4476, "model": "LED1545G12", "modelID": "TRADFRI bulb E27 WS opal 980lm", "networkAddress": 40369, "powerSource": "Mains (single phase)", "type": "Router", "description": "TRADFRI LED bulb E26/E27 980 lumen, dimmable, white spectrum, opal white", "vendor": "IKEA"});
Date.now = now;
});
+27
View File
@@ -1024,4 +1024,31 @@ describe('Entity publish', () => {
expect(endpoint.command).toHaveBeenCalledTimes(0);
expect(logger.error).toHaveBeenCalledWith("No converter available for 'get' 'brightness_move' (20)");
});
it('Should restore brightness when its turned off without transition and is turned on with', async () => {
// https://github.com/Koenkk/zigbee-herdsman-converters/issues/1097
const device = zigbeeHerdsman.devices.bulb_color;
const endpoint = device.getEndpoint(1);
endpoint.command.mockClear();
await MQTT.events.message('zigbee2mqtt/bulb_color/set', JSON.stringify({state: 'ON'}));
await flushPromises();
expect(endpoint.command).toHaveBeenCalledTimes(1);
expect(endpoint.command.mock.calls[0]).toEqual(["genOnOff", "on", {}, {}]);
await MQTT.events.message('zigbee2mqtt/bulb_color/set', JSON.stringify({"state": "ON", "brightness": 123}));
await flushPromises();
expect(endpoint.command).toHaveBeenCalledTimes(2);
expect(endpoint.command.mock.calls[1]).toEqual(["genLevelCtrl", "moveToLevelWithOnOff", {level: 123, transtime: 0}, {}]);
await MQTT.events.message('zigbee2mqtt/bulb_color/set', JSON.stringify({"state": "OFF"}));
await flushPromises();
expect(endpoint.command).toHaveBeenCalledTimes(3);
expect(endpoint.command.mock.calls[2]).toEqual(["genOnOff", "off", {}, {}]);
await MQTT.events.message('zigbee2mqtt/bulb_color/set', JSON.stringify({"state": "ON", "transition": 1.0}));
await flushPromises();
expect(endpoint.command).toHaveBeenCalledTimes(4);
expect(endpoint.command.mock.calls[3]).toEqual(["genLevelCtrl", "moveToLevelWithOnOff", {level: 123, transtime: 10}, {}]);
});
});
+3
View File
@@ -151,6 +151,9 @@ function writeDefaultConfiguration() {
'0x0017880104e43559': {
friendly_name: 'U202DST600ZB'
},
'0x0017880104e44559': {
friendly_name: '3157100_thermostat',
}
},
groups: {
'1': {
+1
View File
@@ -145,6 +145,7 @@ const devices = {
'MKS-CM-W5': new Device('Router', '0x90fd9ffffe4b64ac', 33901, 4476, [new Endpoint(1, [0,4,3,5,10,258,13,19,6,1,1030,8,768,1027,1029,1026], [0,3,4,6,8,5], '0x90fd9ffffe4b64aa', [], {})], true, "Mains (single phase)", "qnazj70", false),
'GL-S-007ZS': new Device('Router', '0x0017880104e45526', 6540,4151, [new Endpoint(1, [0], [], '0x0017880104e45526')], true, "Mains (single phase)", 'GL-S-007ZS'),
'U202DST600ZB': new Device('Router', '0x0017880104e43559', 6540,4151, [new Endpoint(10, [0, 6], [], '0x0017880104e43559'), new Endpoint(11, [0, 6], [], '0x0017880104e43559')], true, "Mains (single phase)", 'U202DST600ZB'),
'3157100': new Device('Router', '0x0017880104e44559', 6542,4151, [new Endpoint(1, [], [], '0x0017880104e44559')], true, "Mains (single phase)", '3157100'),
}
const groups = {