mirror of
https://github.com/Koenkk/zigbee2mqtt.git
synced 2026-08-29 07:08:56 +00:00
Fix tests.
This commit is contained in:
@@ -123,7 +123,7 @@ class DevicePublish {
|
||||
msg[_key] = converted.cmd.toUpperCase();
|
||||
} else if (brightnessConverters.includes(converter)) {
|
||||
msg[_key] = 'ON';
|
||||
msg['brightness'] = converted.zclData.level;
|
||||
msg['brightness'] = Number(converted.zclData.level);
|
||||
}
|
||||
|
||||
this.publishEntityState(entity.ID, msg, true);
|
||||
|
||||
@@ -55,7 +55,7 @@ describe('DevicePublish', () => {
|
||||
chai.assert.deepEqual(zigbee.publish.getCall(0).args[7], null);
|
||||
chai.assert.isTrue(publishEntityState.calledOnce);
|
||||
chai.assert.strictEqual(publishEntityState.getCall(0).args[0], '0x12345678');
|
||||
chai.assert.deepEqual(publishEntityState.getCall(0).args[1], {state: 'ON'});
|
||||
chai.assert.deepEqual(publishEntityState.getCall(0).args[1], {state: 'ON', brightness: 200});
|
||||
chai.assert.strictEqual(publishEntityState.getCall(0).args[2], true);
|
||||
});
|
||||
|
||||
|
||||
Reference in New Issue
Block a user