forked from NEEOInc/neeo-sdk-examples
-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathindex.js
30 lines (23 loc) · 831 Bytes
/
index.js
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
'use strict';
const neeoapi = require('neeo-sdk');
const ExampleController = require('./lib/ExampleController');
const controller = ExampleController.build();
const exampleDriver = neeoapi.buildDevice('Driver SDK Example')
.setManufacturer('NEEO')
.setType('TV')
.addAdditionalSearchToken('SDK')
// Then we add the capabilities of the device
.addButton({ name: 'POWER ON', label: 'POWER ON' })
.addButton({ name: 'POWER OFF', label: 'POWER OFF' })
.addButton({ name: 'INPUT HDMI', label: 'INPUT HDMI' })
// Then we wire the controller handler for these capabilities
.addButtonHandler(controller.onButtonPressed);
/*
* The last step is to export the driver, this makes it available to the
* to tools like the CLI to start running the driver.
*/
module.exports = {
devices: [
exampleDriver,
],
};