setDevicePowerState
Change specified device power state.
Usage
const status = await connection.setDevicePowerState('<your device id>', 'on');
console.log(status);
// multi-channel devices like Sonoff 4CH
const status = await connection.setDevicePowerState('<your device id>', 'toggle', <channel>);
console.log(status);
Possible states: on
, off
, toggle
.
* Remember to instantiate class before use
Response example
{
status: 'ok',
state: 'on'
}
Last update on: September 15th, 2019