From 17ab9705923b89cfb0bee0d91c5987792a561e6d Mon Sep 17 00:00:00 2001 From: Cristian Sandu Date: Tue, 27 Apr 2021 11:51:06 +0300 Subject: [PATCH] Fix passing the serial number to commands The serialNumber is an object {id: 'YK...'} and we need to extract only the id for commands. --- 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); }