type:remote-control
- Remote controls¶
Remote controls are marked with the type remote-control
. Many remote
controls are capable of emitting events when buttons are pressed and implement
the actions-capability. Remote controls are automatically
marked as controllers.
if(thing.matches('type:remote-control')) {
// This is a remote control
if(thing.matches('cap:actions')) {
// Remote control supports listening for actions
}
}
Implementing type¶
const { RemoteControl, Actions } = require('abstract-things/controllers');
class Example extends RemoteControl.with(Actions, ...) {
}