- Devices: Aqara Light Control (Wall Switch)
- Model identifiers:
lumi.ctrl_neutral1
,lumi.ctrl_neutral2
,lumi.ctrl_ln1
,lumi.ctrl_ln2
The supported models of power strips are mapped into a wall-switch
where individual channels are available as child devices. The
child devices are [lights][light] with support for
power switching.
if (device.matches('type:wall-switch')) {
/*
* This device is a wall switch.
*/
}
const light0 = device.child('0');
// For some devices
const light1 = device.child('1');
const light0 = device.child('0');
// Change power to on
light0.power(true)
.then(...)
.catch(...);
// With async/await
await light0.power(true);
- `device.
Power - cap:power
and cap:switchable-power
device.power()
- get if the air purifier is currently activedevice.power(boolean)
- switch the air purifier on, returns a promisedevice.setPower(boolean)
- change the power state of the device, returns a promisedevice.on(power, isOn => ...)
- listen for power changes