diff --git a/config.schema.json b/config.schema.json index 54d424b..debbbc8 100644 --- a/config.schema.json +++ b/config.schema.json @@ -546,6 +546,16 @@ "type": "string", "title": "Volume Down", "placeholder": "eg: KEYCODE_VOLUME_DOWN" + }, + "stateAdbCommand": { + "type": "string", + "title": "State Command", + "placeholder": "eg: dumpsys power | grep mHoldingDisplaySuspendBlocker=" + }, + "stateAdbOutputAwake": { + "type": "string", + "title": "State Command Output", + "placeholder": "eg: true (case sensitive)" } } } @@ -887,6 +897,27 @@ ] } ] + }, + { + "title": "Advance Settings", + "expandable": true, + "expanded": false, + "description": "More advance settings. Leave it blank if you don't know what is this.", + "items": [ + { + "type": "flex", + "displayFlex": true, + "flex-direction": "column", + "items": [ + { + "key": "accessories[].stateAdbCommand" + }, + { + "key": "accessories[].stateAdbOutputAwake" + } + ] + } + ] } ] } diff --git a/index.js b/index.js index 5b1986b..318c98f 100644 --- a/index.js +++ b/index.js @@ -69,6 +69,9 @@ class ADBPlugin { this.enablePlaybackSensor = this.config.playbacksensor || NO; this.playbackSensorDelayOff = this.config.playbacksensordelay || 10000; this.playbackSensorExclude = this.config.playbacksensorexclude || ""; + // State detection + this.stateAdbCommand = this.config.stateAdbCommand; + this.stateAdbOutputAwake = this.config.stateAdbOutputAwake; // Power this.powerOnChange = NO; this.wolLoop = EMPTY; @@ -76,6 +79,9 @@ class ADBPlugin { // App this.currentAppID = HOME_APP_ID; + console.log(this.stateAdbCommand); + console.log(this.stateAdbOutputAwake); + // Accessory status this.adb = new adb(this.ip, { path: this.path, @@ -85,6 +91,8 @@ class ADBPlugin { retryPowerOn: this.retryPowerOn, keycodePowerOn: this.config.poweron, keycodePowerOff: this.config.poweroff, + stateAdbCommand: this.stateAdbCommand, + stateAdbOutputAwake: this.stateAdbOutputAwake }); /** diff --git a/package.json b/package.json index 00cd267..6f492cc 100644 --- a/package.json +++ b/package.json @@ -1,11 +1,11 @@ { "name": "homebridge-adb", - "version": "2.2.6", + "version": "2.2.7", "description": "A HomeBridge plugin to control ADB enabled Android devices", "main": "index.js", "engines": { - "node": ">=14.0.0", - "homebridge": ">=1.1.0" + "node": ">=18.0.0", + "homebridge": ">=1.5.0" }, "scripts": { "test": "npm link && nodemon" @@ -28,12 +28,12 @@ }, "homepage": "https://github.com/dwaan/homebridge-adb#readme", "dependencies": { - "nodejs-adb-wrapper": "1.3.8", + "nodejs-adb-wrapper": "1.3.9", "wake_on_lan": "1.0.0" }, "devDependencies": { - "homebridge": "^1.3.9", - "nodemon": "^3.0.1" + "homebridge": "^1.5.0", + "nodemon": "^3.0.3" }, "funding": [ {