From 175aed337025d4b9ea45a811894b549863479b61 Mon Sep 17 00:00:00 2001 From: jsetton Date: Tue, 14 Dec 2021 12:24:24 -0500 Subject: [PATCH] Cache openhab posted command as string Signed-off-by: jsetton --- lambda/openhab/index.js | 2 +- lambda/test/openhab.test.js | 2 +- 2 files changed, 2 insertions(+), 2 deletions(-) diff --git a/lambda/openhab/index.js b/lambda/openhab/index.js index 773fcfe5..7bac5c43 100644 --- a/lambda/openhab/index.js +++ b/lambda/openhab/index.js @@ -111,7 +111,7 @@ class OpenHAB { */ sendCommand(itemName, command) { // Cache posted command - this._cache.postedCommands[itemName] = command; + this._cache.postedCommands[itemName] = command.toString(); return this.postItemCommand(itemName, command); } diff --git a/lambda/test/openhab.test.js b/lambda/test/openhab.test.js index 58e03fcd..e7f3d1f1 100644 --- a/lambda/test/openhab.test.js +++ b/lambda/test/openhab.test.js @@ -398,7 +398,7 @@ describe('OpenHAB Tests', () => { nock(baseURL).post('/rest/items/foo', '42').reply(200); // run test await openhab.sendCommand('foo', 42); - expect(openhab.getLastPostedCommand('foo')).to.equals(42); + expect(openhab.getLastPostedCommand('foo')).to.equals('42'); expect(nock.isDone()).to.be.true; });