Skip to content

Commit

Permalink
Cache openhab posted command as string (#446)
Browse files Browse the repository at this point in the history
Signed-off-by: jsetton <jeremy.setton@gmail.com>
  • Loading branch information
jsetton authored Dec 14, 2021
1 parent 59707cc commit b2e16da
Show file tree
Hide file tree
Showing 2 changed files with 2 additions and 2 deletions.
2 changes: 1 addition & 1 deletion lambda/openhab/index.js
Original file line number Diff line number Diff line change
Expand Up @@ -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);
}

Expand Down
2 changes: 1 addition & 1 deletion lambda/test/openhab.test.js
Original file line number Diff line number Diff line change
Expand Up @@ -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;
});

Expand Down

0 comments on commit b2e16da

Please sign in to comment.