mirror of
https://github.com/Koenkk/zigbee2mqtt.git
synced 2024-11-16 10:28:33 -07:00
Update zigbee-shepherd-converters to 8.0.11.
This commit is contained in:
parent
0277591085
commit
e537784d34
@ -115,8 +115,9 @@ class DevicePublish {
|
||||
msg['brightness'] = 0;
|
||||
}
|
||||
} else if (converted.cid === 'genLevelCtrl' && converted.cmd === 'moveToLevelWithOnOff') {
|
||||
msg[_key] = 'ON';
|
||||
msg['brightness'] = Number(converted.zclData.level);
|
||||
const brightness = Number(converted.zclData.level);
|
||||
msg[_key] = brightness === 0 ? 'OFF' : 'ON';
|
||||
msg['brightness'] = brightness;
|
||||
} else if (converted.cid === 'genLevelCtrl' && converted.cmd === 'moveToLevel') {
|
||||
msg['brightness'] = Number(converted.zclData.level);
|
||||
}
|
||||
|
6
npm-shrinkwrap.json
generated
6
npm-shrinkwrap.json
generated
@ -6447,9 +6447,9 @@
|
||||
}
|
||||
},
|
||||
"zigbee-shepherd-converters": {
|
||||
"version": "8.0.10",
|
||||
"resolved": "https://registry.npmjs.org/zigbee-shepherd-converters/-/zigbee-shepherd-converters-8.0.10.tgz",
|
||||
"integrity": "sha512-d45yVA4MIIvNTyw3K3BTUd61GOEP163ePYfKN4tfr+bwBVVhWrtWazQWuaxjxpte23feLc9ft24200KCz0rKhA==",
|
||||
"version": "8.0.11",
|
||||
"resolved": "https://registry.npmjs.org/zigbee-shepherd-converters/-/zigbee-shepherd-converters-8.0.11.tgz",
|
||||
"integrity": "sha512-w3EmkKhiiNiH8d3K3s8vPm125OfT+vrWVV6rIhPbpMcODzhclL2trSB7IWFlsjxaAVIroHz8DkAUIbscbd3MDw==",
|
||||
"requires": {
|
||||
"chai": "*",
|
||||
"debounce": "*",
|
||||
|
@ -46,7 +46,7 @@
|
||||
"zcl-id": "git+https://github.com/Koenkk/zcl-id.git#4fa75c92424cd070a3bf6e1f4640b1e3ad8f802d",
|
||||
"ziee": "*",
|
||||
"zigbee-shepherd": "git+https://github.com/Koenkk/zigbee-shepherd.git#a8b5828200140adf4de83457508576f6879f7ec1",
|
||||
"zigbee-shepherd-converters": "8.0.10",
|
||||
"zigbee-shepherd-converters": "8.0.11",
|
||||
"zive": "*"
|
||||
},
|
||||
"devDependencies": {
|
||||
|
@ -855,4 +855,48 @@ describe('DevicePublish', () => {
|
||||
'functional', {}, cfg.default, null, expect.any(Function)
|
||||
);
|
||||
});
|
||||
|
||||
it('Should turn device off when brightness 0 is send with light_brightness converter', async () => {
|
||||
zigbee.publish.mockClear();
|
||||
publishEntityState.mockClear();
|
||||
zigbee.getDevice = () => ({modelId: 'TRADFRI bulb E27 CWS opal 600lm'});
|
||||
devicePublish.onMQTTMessage('zigbee2mqtt/0x00000001/set', JSON.stringify({state: 'ON', transition: 1}));
|
||||
expect(zigbee.publish).toHaveBeenCalledTimes(1);
|
||||
expect(zigbee.publish).toHaveBeenNthCalledWith(1,
|
||||
'0x00000001',
|
||||
'device',
|
||||
'genLevelCtrl',
|
||||
'moveToLevelWithOnOff',
|
||||
'functional',
|
||||
{level: 255, transtime: 10},
|
||||
cfg.default,
|
||||
null,
|
||||
expect.any(Function));
|
||||
expect(publishEntityState).toHaveBeenCalledTimes(1);
|
||||
expect(publishEntityState).toHaveBeenNthCalledWith(1,
|
||||
'0x00000001',
|
||||
{state: 'ON', brightness: 255});
|
||||
});
|
||||
|
||||
it('Should turn device off when brightness 0 is send with light_brightness converter', async () => {
|
||||
zigbee.publish.mockClear();
|
||||
publishEntityState.mockClear();
|
||||
zigbee.getDevice = () => ({modelId: 'TRADFRI bulb E27 CWS opal 600lm'});
|
||||
devicePublish.onMQTTMessage('zigbee2mqtt/0x00000001/set', JSON.stringify({state: 'OFF', transition: 2}));
|
||||
expect(zigbee.publish).toHaveBeenCalledTimes(1);
|
||||
expect(zigbee.publish).toHaveBeenNthCalledWith(1,
|
||||
'0x00000001',
|
||||
'device',
|
||||
'genLevelCtrl',
|
||||
'moveToLevelWithOnOff',
|
||||
'functional',
|
||||
{level: 0, transtime: 20},
|
||||
cfg.default,
|
||||
null,
|
||||
expect.any(Function));
|
||||
expect(publishEntityState).toHaveBeenCalledTimes(1);
|
||||
expect(publishEntityState).toHaveBeenNthCalledWith(1,
|
||||
'0x00000001',
|
||||
{state: 'OFF', brightness: 0});
|
||||
});
|
||||
});
|
||||
|
Loading…
Reference in New Issue
Block a user