Skip to content

Commit

Permalink
Update converters.
Browse files Browse the repository at this point in the history
  • Loading branch information
Koenkk committed Jun 6, 2020
1 parent d66e1c3 commit f8ea6cb
Show file tree
Hide file tree
Showing 4 changed files with 20 additions and 4 deletions.
1 change: 1 addition & 0 deletions lib/extension/homeassistant.js
Original file line number Diff line number Diff line change
Expand Up @@ -1688,6 +1688,7 @@ const mapping = {
'TI0001-switch': [cfg.switch],
'TI0001-socket': [cfg.switch],
'9290022891': [cfg.light_brightness_colortemp_colorxy],
'ZS232000178': [cfg.sensor_action],
};

/**
Expand Down
6 changes: 3 additions & 3 deletions npm-shrinkwrap.json

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

2 changes: 1 addition & 1 deletion package.json
Original file line number Diff line number Diff line change
Expand Up @@ -47,7 +47,7 @@
"winston": "*",
"winston-syslog": "*",
"zigbee-herdsman": "0.12.91",
"zigbee-herdsman-converters": "12.0.105"
"zigbee-herdsman-converters": "12.0.108"
},
"devDependencies": {
"eslint": "*",
Expand Down
15 changes: 15 additions & 0 deletions test/publish.test.js
Original file line number Diff line number Diff line change
Expand Up @@ -524,6 +524,21 @@ describe('Publish', () => {
expectNothingPublished();
});

it('Should send state update on toggle specific endpoint', async () => {
const device = zigbeeHerdsman.devices.QBKG03LM;
const endpoint = device.getEndpoint(2);
await MQTT.events.message('zigbee2mqtt/wall_switch_double/left/set', 'ON');
await flushPromises();
await MQTT.events.message('zigbee2mqtt/wall_switch_double/left/set', 'TOGGLE');
await flushPromises();
expect(endpoint.command).toHaveBeenCalledTimes(2);
expect(endpoint.command).toHaveBeenCalledWith("genOnOff", "on", {}, {});
expect(endpoint.command).toHaveBeenCalledWith("genOnOff", "toggle", {}, {});
expect(MQTT.publish).toHaveBeenCalledTimes(2);
expect(MQTT.publish.mock.calls[0]).toEqual(["zigbee2mqtt/wall_switch_double", JSON.stringify({state_left: 'ON'}), {"qos": 0, "retain": false}, expect.any(Function)]);
expect(MQTT.publish.mock.calls[1]).toEqual(["zigbee2mqtt/wall_switch_double", JSON.stringify({state_left: 'OFF'}), {"qos": 0, "retain": false}, expect.any(Function)]);
});

it('Should parse set with postfix topic and attribute', async () => {
const device = zigbeeHerdsman.devices.QBKG03LM;
const endpoint = device.getEndpoint(2);
Expand Down

0 comments on commit f8ea6cb

Please sign in to comment.