Closed Tuxdiver closed 6 years ago
I can't reproduce your issue. You didn't provide the code but I assume you are passing a string instead of a number.
const { Client } = require('..');
const client = new Client({logLevel: 'debug'});
client.getDevice({host: '10.0.0.124'}).then((device) => {
device.reboot(1);
});
[2] client.sendTcp({"payload":{"system":{"reboot":{"delay":1}}},"host":"10.0.0.124","port":9999,"timeout":5000})
[2] client.sendTcp(): attempting to open. host:10.0.0.124, port:9999
[2] client.sendTcp(): socket:connect 10.0.0.124 9999
[2] client.sendTcp(): socket:data 10.0.0.124:9999 segment:1
[2] client.sendTcp(): socket:data message: {"system":{"reboot":{"err_code":0}}}
Sorry, forget to mention: I used the tplink-smarthome-api
CLI
Thanks! fixed in v0.21.0
I tried to reboot a switch (after it stopped sending emeter values), but it only gave an error message:
{ err_code: -3, err_msg: 'invalid argument' }
I think, your internal reboot command sends the delay value as a string:
[2] client.sendTcp({"payload":{"system":{"reboot":{"delay":"1"}}},"host":"192.168.178.27","port":9999,"timeout":5000})
In contrast to
which worked for me.
Systeminfo: