Don't turn on with 255 brightness when transition is provided. https://github.com/Koenkk/zigbee2mqtt/issues/2220

This commit is contained in:
Koenkk 2019-10-28 18:07:15 +01:00
parent 646cd34715
commit 754db956b5

View File

@ -658,14 +658,14 @@ describe('Entity publish', () => {
});
it('Should turn device off when brightness 0 is send with light_brightness converter ON', async () => {
it('Should turn device on with on/off when transition is provided', async () => {
const device = zigbeeHerdsman.devices.bulb_color;
const endpoint = device.getEndpoint(1);
const payload = {state: 'ON', transition: 1};
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(["genLevelCtrl", "moveToLevelWithOnOff", {level: 255, transtime: 10}, {}]);
expect(endpoint.command.mock.calls[0]).toEqual(["genOnOff", "on", {}, {}]);
});
it('Should turn device off when brightness 0 is send with light_brightness converter OFF', async () => {