From aa54365cec0318435b0ce72650dcee3dda7669a0 Mon Sep 17 00:00:00 2001 From: Cristian Sandu Date: Tue, 27 Apr 2021 11:36:58 +0300 Subject: [PATCH 1/2] Fix package entrypoint This allows it to be used using require() and npm. --- package.json | 1 + 1 file changed, 1 insertion(+) diff --git a/package.json b/package.json index 51c8b53..adaee8f 100644 --- a/package.json +++ b/package.json @@ -12,6 +12,7 @@ "type": "git", "url": "git+https://github.com/opentmi/ykushjs.git" }, + "main": "src/index.js", "keywords": [ "power", "switch", From c87f42055a02d9e46a332170bfd92be1d8cbb877 Mon Sep 17 00:00:00 2001 From: Cristian Sandu Date: Tue, 27 Apr 2021 11:52:33 +0300 Subject: [PATCH 2/2] Fix serialNumber --- src/Ykush.js | 8 ++++---- 1 file changed, 4 insertions(+), 4 deletions(-) diff --git a/src/Ykush.js b/src/Ykush.js index afa96a3..a3a93ec 100644 --- a/src/Ykush.js +++ b/src/Ykush.js @@ -28,12 +28,12 @@ class Ykush { } async powerAllOn() { - const args = [...this._prefix, '-s', this._serialNumber, '-u', 'a']; + const args = [...this._prefix, '-s', this._serialNumber.id, '-u', 'a']; return Ykush._runYkushCmd(args); } async powerAllOff() { - const args = [...this._prefix, '-s', this._serialNumber, '-d', 'a']; + const args = [...this._prefix, '-s', this._serialNumber.id, '-d', 'a']; return Ykush._runYkushCmd(args); } @@ -45,13 +45,13 @@ class Ykush { async powerOn({channel}) { this._validateChannel(channel); - const args = [...this._prefix, '-s', this._serialNumber, '-u', `${channel}`]; + const args = [...this._prefix, '-s', this._serialNumber.id, '-u', `${channel}`]; return Ykush._runYkushCmd(args); } async powerOff({channel}) { this._validateChannel(channel); - const args = [...this._prefix, '-s', this._serialNumber, '-d', `${channel}`]; + const args = [...this._prefix, '-s', this._serialNumber.id, '-d', `${channel}`]; return Ykush._runYkushCmd(args); }