Skip to content

Commit

Permalink
Enhancement
Browse files Browse the repository at this point in the history
- Inputs id / name is mandatory now
- Add input information in README.md
  • Loading branch information
dwaan committed May 20, 2021
1 parent e879132 commit c2f9db4
Show file tree
Hide file tree
Showing 2 changed files with 8 additions and 3 deletions.
3 changes: 3 additions & 0 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -142,6 +142,9 @@ Here an example of configuration that you can use. If you're using Homebridge Co
* **name** (mandatory): the name of the device.
* **ip** (mandatory): the IP address of the device.
* *inputs* (optional): by default the plugins will create Home for launcher shortcut and Other for previous app shortcut as input. If set, the plugins will add more input based on the config. To know your app id, please see your Homebridge log. When you live this black, and set *hidehhome* and *hideother* to true, the plugins will hide inputs in Home App.
* *name* (mandatory): the name of the input
* *id* (mandatory): the application id
* *adb* (optional): you can run you own adb shell command here, such as: `monkey -p com.app.id 1`
* *interval* (optional): if not set, the plugin will check device statuses every 5000 miliseconds.
* *playbacksensor* (optional): if set to *true*, plugin will create a motion sensor based on playback activity (either video or music).
* *category* (optional): you can choose from this categories: *APPLE_TV, TELEVISION, TV_STREAMING_STICK, TV_SET_TOP_BOX, AUDIO_RECEIVER, or SPEAKER*. Home app will display different icon based on the category you choose.
Expand Down
8 changes: 5 additions & 3 deletions index.js
Original file line number Diff line number Diff line change
Expand Up @@ -249,8 +249,8 @@ class ADBPlugin {
let humanNumber = i + 1;
if(humanNumber < 10) humanNumber = "0" + (i + 1);

if(i >= this.inputs.length) {
// Create hidden input for future modification
if(i >= this.inputs.length || !input.name || !input.id) {
// Create hidden input when name and id is empty and for future modification
configured = Characteristic.IsConfigured.NOT_CONFIGURED;
targetVisibility = Characteristic.TargetVisibilityState.HIDDEN;
currentVisibility = Characteristic.CurrentVisibilityState.HIDDEN;
Expand Down Expand Up @@ -341,9 +341,11 @@ class ADBPlugin {
this.deviceService.updateCharacteristic(Characteristic.Active, state);
});
}
} else {
} else if(err) {
this.log.info(this.name, "- Device not responding");
this.displayDebug("handleOnOff - Error - " + stderr.trim());
} else {
this.deviceService.updateCharacteristic(Characteristic.Active, state);
}
});

Expand Down

0 comments on commit c2f9db4

Please sign in to comment.