Skip to content

Commit

Permalink
0.7.7
Browse files Browse the repository at this point in the history
  • Loading branch information
cbrandlehner committed Feb 12, 2020
1 parent 43d4259 commit 2b99dd0
Show file tree
Hide file tree
Showing 4 changed files with 78 additions and 2 deletions.
6 changes: 6 additions & 0 deletions config.schema.json
Original file line number Diff line number Diff line change
Expand Up @@ -2,6 +2,12 @@
"pluginAlias": "Onkyo",
"pluginType": "platform",
"schema": {
"name": {
"title": "Name",
"type": "string",
"required": true,
"default": "Onkyo"
},
"receivers": {
"type": "array",
"items": {
Expand Down
63 changes: 63 additions & 0 deletions config.schema.json.old
Original file line number Diff line number Diff line change
@@ -0,0 +1,63 @@
{
"pluginAlias": "Onkyo",
"pluginType": "platform",
"singular": true;
"schema": {
"type": "object",
"properties": {
"name": {
"title": "Name",
"type": "string",
"required": true,
"default": "Onkyo Stereo"
},
"ip_address": {
"title": "IP-Address or hostname",
"type": "string",
"required": true,
"default": "10.0.1.23"
},
"model": {
"title": "Model",
"type": "string",
"required": true,
"default": "TX-NR609"
},
"poll_status_interval": {
"title": "Polling interval (0 for no polling)",
"type": "string",
"required": false,
"default": "0"
},
"default_input": {
"title": "Default input (optional)",
"type": "string",
"required": false,
"default": "net"
},
"default_volume": {
"title": "Default volume (optional)",
"type": "string",
"required": false,
"default": "10"
},
"max_volume": {
"title": "Maximum volume (optional)",
"type": "string",
"required": false,
"default": "35"
},
"map_volume_100": {
"title": "Map Volume (optional)",
"type": "boolean",
"default": false,
"description": "Will remap the volume percentages that appear in the Home app so that the configured max_volume will appear as 100% in the Home app. For example, if the max_volume is 30, then setting the volume slider to 50% would set the receiver's actual volume to 15. Adjusting the stereo volume knob to 35 will appear as 100% in the Home app. This option could confuse some users to it defaults to off false, but it does give the user finer volume control especially when sliding volume up and down in the Home app."
},
"zone": {
"title": "Zone",
"type": "string",
"enum": [ "main", "zone2" ]
}
}
}
}
9 changes: 8 additions & 1 deletion index.js
Original file line number Diff line number Diff line change
Expand Up @@ -79,7 +79,9 @@ class OnkyoAccessory {
//

this.volume_dimmer = this.config.volume_dimmer || true;
this.log.debug('volume_dimmer: %s', this.volume_dimmer);
this.filter_inputs = this.config.filter_inputs || false;
this.log.debug('filter_inputs: %s', this.filter_inputs);

this.cmdMap = new Array(2);
this.cmdMap.main = new Array(4);
Expand All @@ -94,10 +96,15 @@ class OnkyoAccessory {
this.cmdMap.zone2.input = 'selector';

this.poll_status_interval = this.config.poll_status_interval || '0';
this.log.debug('poll_status_interval: %s', this.poll_status_interval);
this.defaultInput = this.config.default_input;
this.log.debug('defaultInput: %s', this.defaultInput);
this.defaultVolume = this.config.default_volume;
this.log.debug('defaultVolume: %s', this.defaultVolume);
this.maxVolume = this.config.max_volume || 60;
this.log.debug('maxVolume: %s', this.maxVolume);
this.mapVolume100 = this.config.map_volume_100 || true;
this.log.debug('mapVolume100: %s', this.mapVolume100);

this.buttons = {
[Characteristic.RemoteKey.REWIND]: 'rew',
Expand All @@ -122,7 +129,7 @@ class OnkyoAccessory {
this.interval = parseInt(this.poll_status_interval, 10);
this.avrManufacturer = 'Onkyo';
this.avrSerial = this.config.serial || this.ip_address;

this.log.debug('avrSerial: %s', this.avrSerial);
this.switchHandling = 'check';
if (this.interval > 10 && this.interval < 100000)
this.switchHandling = 'poll';
Expand Down
2 changes: 1 addition & 1 deletion package.json
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
{
"name": "homebridge-onkyo",
"version": "0.7.6",
"version": "0.7.7",
"description": "Homebridge plugin for Onkyo Receivers",
"main": "index.js",
"scripts": {
Expand Down

0 comments on commit 2b99dd0

Please sign in to comment.