homebridge-androidtv
Version:
Homebridge plugin to control your AndroidTV / Freebox Player Pop / Freemox Mini 4k
62 lines (55 loc) • 1.37 kB
JavaScript
"use strict";
Object.defineProperty(exports, "__esModule", {
value: true
});
exports.Device = void 0;
var _androidtvRemote = require("androidtv-remote");
class Device {
constructor(host, port, name, cert, type) {
this.host = host;
this.port = port;
this.name = name;
this.pairing = false;
this.paired = false;
this.online = false;
this.powered = false;
this.started = false;
this.volume_current = 0;
this.volume_max = 0;
this.volume_muted = false;
this.app_package_current = "";
this.android_remote = new _androidtvRemote.AndroidRemote(this.host, {
pairing_port: this.port + 1,
remote_port: this.port,
name: 'homebridge-plugin-googletv',
cert: cert
});
this.type = type;
}
toJSONSaver() {
return {
host: this.host,
port: this.port,
name: this.name,
paired: this.paired,
type: this.type
};
}
toJSON() {
return {
host: this.host,
name: this.name,
paired: this.paired,
pairing: this.pairing,
powered: this.powered,
online: this.online,
started: this.started,
volume_max: this.volume_max,
volume_current: this.volume_current,
volume_muted: this.volume_muted,
app_package_current: this.app_package_current,
type: this.type
};
}
}
exports.Device = Device;