Fix tests.

This commit is contained in:
Koen Kanters
2019-02-26 21:06:48 +01:00
parent 709046db2a
commit 61116ec670
2 changed files with 2 additions and 2 deletions
+1 -1
View File
@@ -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);
+1 -1
View File
@@ -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);
});