Skip to content

Latest commit

 

History

History
39 lines (28 loc) · 777 Bytes

controller.md

File metadata and controls

39 lines (28 loc) · 777 Bytes

Switch

  • device.type: controller
  • Models: Aqara Switch, Aqara Cube, Aqara Light Switch
  • Model identifiers: lumi.switch, lumi.cube

The controller type is used for anything that used primarily for controlling something else. It's primary function is that it emits an event named action when someone interacts with the device.

device.on('action', action => /* do something useful */);

Basic API

Event: action

Emitted when a certain action is performed on the device, such as it is clicked or flipped or whatever is supported by the device.

Example payloads:

{
	id: 'click'
}
{
	id: 'rotate',
	amount: -28
}

device.actions: Array[string]

Get the actions supported by the device.