Update converters.

This commit is contained in:
Koen Kanters
2019-11-10 19:53:37 +01:00
parent be1c81a778
commit 0b0a9bca4d
5 changed files with 36 additions and 11 deletions
+1
View File
@@ -967,6 +967,7 @@ const mapping = {
'TERNCY-PP01': [cfg.sensor_temperature, cfg.binary_sensor_occupancy, cfg.sensor_illuminance, cfg.sensor_click],
'CR11S8UZ': [cfg.sensor_action],
'RB 148 T': [cfg.light_brightness_colortemp],
'STS-OUT-US-2': [cfg.switch],
};
Object.keys(mapping).forEach((key) => {
+9 -9
View File
@@ -4612,9 +4612,9 @@
"dev": true
},
"prompts": {
"version": "2.2.1",
"resolved": "https://registry.npmjs.org/prompts/-/prompts-2.2.1.tgz",
"integrity": "sha512-VObPvJiWPhpZI6C5m60XOzTfnYg/xc/an+r9VYymj9WJW3B/DIH+REzjpAACPf8brwPeP+7vz3bIim3S+AaMjw==",
"version": "2.3.0",
"resolved": "https://registry.npmjs.org/prompts/-/prompts-2.3.0.tgz",
"integrity": "sha512-NfbbPPg/74fT7wk2XYQ7hAIp9zJyZp5Fu19iRbORqqy1BhtrkZ0fPafBU+7bmn8ie69DpT0R6QpJIN2oisYjJg==",
"dev": true,
"requires": {
"kleur": "^3.0.3",
@@ -5033,9 +5033,9 @@
}
},
"sisteransi": {
"version": "1.0.3",
"resolved": "https://registry.npmjs.org/sisteransi/-/sisteransi-1.0.3.tgz",
"integrity": "sha512-SbEG75TzH8G7eVXFSN5f9EExILKfly7SUvVY5DhhYLvfhKqhDFY0OzevWa/zwak0RLRfWS5AvfMWpd9gJvr5Yg==",
"version": "1.0.4",
"resolved": "https://registry.npmjs.org/sisteransi/-/sisteransi-1.0.4.tgz",
"integrity": "sha512-/ekMoM4NJ59ivGSfKapeG+FWtrmWvA1p6FBZwXrqojw90vJu8lBmrTxCMuBCydKtkaUe2zt4PlxeTKpjwMbyig==",
"dev": true
},
"slash": {
@@ -12637,9 +12637,9 @@
}
},
"zigbee-herdsman-converters": {
"version": "11.1.40",
"resolved": "https://registry.npmjs.org/zigbee-herdsman-converters/-/zigbee-herdsman-converters-11.1.40.tgz",
"integrity": "sha512-E2raZCAWdTv7MIPvGICJmbo8Bhw4A4eQPCS96p2/oXgwmdYNTCC9iClCqbz7oX9NaeeBuh03s3ctiPOAa9QJyg=="
"version": "11.1.41",
"resolved": "https://registry.npmjs.org/zigbee-herdsman-converters/-/zigbee-herdsman-converters-11.1.41.tgz",
"integrity": "sha512-zNcpbpSOzVaLyWWApKOB+qkNeIzRY2bjTLRVULiX/InvFnY51VupxPF5bw+Ul3kXCZOXcDftBADxQ57WeTpSnQ=="
}
}
}
+1 -1
View File
@@ -46,7 +46,7 @@
"semver": "*",
"winston": "*",
"zigbee-herdsman": "0.12.3",
"zigbee-herdsman-converters": "11.1.40"
"zigbee-herdsman-converters": "11.1.41"
},
"devDependencies": {
"eslint": "*",
+24
View File
@@ -752,6 +752,30 @@ describe('Entity publish', () => {
expect(JSON.parse(MQTT.publish.mock.calls[0][1])).toStrictEqual({color: {x: 0.41, y: 0.25}, color_temp: 150, state: 'ON'});
});
it('Should publish correct state on toggle command to zigbee bulb', async () => {
const endpoint = zigbeeHerdsman.devices.bulb_color.getEndpoint(1);
await MQTT.events.message('zigbee2mqtt/bulb_color/set', JSON.stringify({state: 'TOGGLE'}));
await flushPromises();
// At this point the bulb has no state yet, so we cannot determine the next state and therefore shouldn't publish it to MQTT.
expect(endpoint.command).toHaveBeenCalledTimes(1);
expect(endpoint.command).toHaveBeenCalledWith("genOnOff", "toggle", {}, {});
expect(MQTT.publish).toHaveBeenCalledTimes(0);
// Turn bulb off so that the bulb gets a state.
await MQTT.events.message('zigbee2mqtt/bulb_color/set', JSON.stringify({state: 'OFF'}));
await flushPromises();
// Toggle again, now that we have state it should publish state ON
await MQTT.events.message('zigbee2mqtt/bulb_color/set', JSON.stringify({state: 'TOGGLE'}));
await flushPromises();
expect(endpoint.command).toHaveBeenCalledTimes(3);
expect(MQTT.publish).toHaveBeenCalledTimes(2);
expect(MQTT.publish.mock.calls[1][0]).toStrictEqual('zigbee2mqtt/bulb_color');
expect(JSON.parse(MQTT.publish.mock.calls[1][1])).toStrictEqual({state: 'ON'});
expect(MQTT.publish.mock.calls[1][2]).toStrictEqual({"qos": 0, "retain": false});
});
it('Should publish messages with options disableDefaultResponse', async () => {
const device = zigbeeHerdsman.devices.GLEDOPTO1112;
const endpoint = device.getEndpoint(11);
+1 -1
View File
@@ -91,7 +91,7 @@ describe('Settings', () => {
settings.getDevice('0x12345678');
});
it('onlythis Should read MQTT username asn password form a separate file', () => {
it('Should read MQTT username asn password form a separate file', () => {
const contentConfiguration = {
mqtt: {
server: 'my.mqtt.server',