Compare commits

...

3 commits

Author SHA1 Message Date
Martin Giger 3e188e7054
version: 1.0.1 2021-08-11 21:44:40 +02:00
Martin Giger 671ea3fd6e
fix: gateway compat 2021-08-11 21:42:20 +02:00
Martin Giger f2785c52b8
feat: add on-off capability 2021-07-25 15:30:59 +02:00
3 changed files with 7 additions and 6 deletions

View file

@ -172,6 +172,7 @@ class IRUSBDevice extends Device {
constructor(adapter, uuid, ip, port) {
super(adapter, uuid);
this.name = uuid;
this['@type'] = [ 'OnOffSwitch' ];
this.socket = new net.Socket();
this.socket.setEncoding('ascii');
this.addProperty(new IRUSBProperty(this, 'power', {
@ -317,13 +318,13 @@ class IRUSBDevice extends Device {
* @param {Action} action
*/
async performAction(action) {
switch(action.getName()) {
switch(action.name) {
case 'launch':
return this.sendCommand(`LAUNCH ${action.getInput()}`);
return this.sendCommand(`LAUNCH ${action.input}`);
case 'remoteShort':
return this.sendKey(action.getInput(), false);
return this.sendKey(action.input, false);
case 'remoteLong':
return this.sendKey(action.getInput(), true);
return this.sendKey(action.input, true);
case 'cancelKeys':
return this.sendCommand('HIDCODE0000000');
}

View file

@ -3,7 +3,7 @@
"id": "irusb-adapter",
"name": "IrUSB",
"short_name": "IrUSB",
"version": "1.0.0",
"version": "1.0.1",
"description": "Adapter for Video Lan IrUSB devices (Android TV, nVidia Shield with an adapter)",
"homepage_url": "https://git.humanoids.be/freaktechnik/irusb-adapter",
"license": "MIT",

View file

@ -1,6 +1,6 @@
{
"name": "irusb-adapter",
"version": "1.0.0",
"version": "1.0.1",
"description": "webthings.io gateway adapter for the Video Storm IrUSB device. Allows control of Android TV devices like nVidia Shield over Network.",
"main": "index.js",
"scripts": {