-
-
Notifications
You must be signed in to change notification settings - Fork 3.6k
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
[androiddebugbridge] initial contribution #9259
Conversation
Signed-off-by: Miguel <[email protected]>
Thank you very much for your contribution. Will it be possible to control / connect to Fire TV Sticks by this binding? I would be very much interested in that feature. |
@cweitkamp. I'm happy to say it does :D , at least the Firestick 4k is the device that I'm using with the binding right now. Everything seems to work nicely unless the audio dimmer which I was not able to read/write from the adb. The audio dimmer works properly on the other device that I test with, my old nexus 5x. |
I can't find the build for this pr on the ci. I think there was some kind of error and it was not created. Can you trigger a rebuild? Thanks in advance. |
Yes, of course. You can do that on your own by adding the "rebuild" label to your PR. |
Signed-off-by: Miguel <[email protected]>
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Thanks for your contribution! I reviewed your code and here is my feedback.
bundles/org.openhab.binding.androiddebugbridge/src/main/resources/OH-INF/binding/binding.xml
Outdated
Show resolved
Hide resolved
bundles/org.openhab.binding.androiddebugbridge/src/main/resources/OH-INF/binding/binding.xml
Outdated
Show resolved
Hide resolved
bundles/org.openhab.binding.androiddebugbridge/src/main/resources/OH-INF/binding/binding.xml
Outdated
Show resolved
Hide resolved
bundles/org.openhab.binding.androiddebugbridge/src/main/resources/OH-INF/thing/thing-types.xml
Outdated
Show resolved
Hide resolved
...src/main/java/org/openhab/binding/androiddebugbridge/internal/AndroidDebugBridgeHandler.java
Outdated
Show resolved
Hide resolved
Signed-off-by: Miguel <[email protected]>
Signed-off-by: Miguel <[email protected]>
Signed-off-by: Miguel <[email protected]>
Signed-off-by: Miguel <[email protected]>
I think everything is done. |
...java/org/openhab/binding/androiddebugbridge/internal/AndroidDebugBridgeDiscoveryService.java
Outdated
Show resolved
Hide resolved
...java/org/openhab/binding/androiddebugbridge/internal/AndroidDebugBridgeDiscoveryService.java
Outdated
Show resolved
Hide resolved
...n/java/org/openhab/binding/androiddebugbridge/internal/AndroidDebugBridgeHandlerFactory.java
Outdated
Show resolved
Hide resolved
Signed-off-by: Miguel <[email protected]>
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
LGTM
.../src/main/java/org/openhab/binding/androiddebugbridge/internal/AndroidDebugBridgeDevice.java
Outdated
Show resolved
Hide resolved
...java/org/openhab/binding/androiddebugbridge/internal/AndroidDebugBridgeDiscoveryService.java
Outdated
Show resolved
Hide resolved
...src/main/java/org/openhab/binding/androiddebugbridge/internal/AndroidDebugBridgeHandler.java
Outdated
Show resolved
Hide resolved
...src/main/java/org/openhab/binding/androiddebugbridge/internal/AndroidDebugBridgeHandler.java
Outdated
Show resolved
Hide resolved
...src/main/java/org/openhab/binding/androiddebugbridge/internal/AndroidDebugBridgeHandler.java
Show resolved
Hide resolved
...java/org/openhab/binding/androiddebugbridge/internal/AndroidDebugBridgeDiscoveryService.java
Outdated
Show resolved
Hide resolved
.../src/main/java/org/openhab/binding/androiddebugbridge/internal/AndroidDebugBridgeDevice.java
Outdated
Show resolved
Hide resolved
...java/org/openhab/binding/androiddebugbridge/internal/AndroidDebugBridgeDiscoveryService.java
Outdated
Show resolved
Hide resolved
Signed-off-by: Miguel <[email protected]>
Signed-off-by: Miguel <[email protected]>
I installed a version containing your latest changes and will check on the "state_dectection_rules". Thanks. One thing which came up after a power loss of the Fire TV is a recurring warning in my logs. I am not sure why, but it looks like the binding cannot connect anymore.
|
Signed-off-by: Miguel <[email protected]>
Signed-off-by: Miguel <[email protected]>
Signed-off-by: Miguel <[email protected]>
Now the thing connect again correctly. Thanks for pointing that. |
Sry, I did non come back to you earlier. The latest version from last Sunday looks better. But can still see a warning in my logs when the binding tries to reconnect. I this situation my Fire TV Stick is in standby mode. Unfortunately it does not help to wake it up. I have to perform a full restart of the Fire TV Stick to establish a working connection again.
|
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
some minor improvements
bundles/org.openhab.binding.androiddebugbridge/src/main/resources/OH-INF/thing/thing-types.xml
Outdated
Show resolved
Hide resolved
bundles/org.openhab.binding.androiddebugbridge/src/main/resources/OH-INF/thing/thing-types.xml
Outdated
Show resolved
Hide resolved
bundles/org.openhab.binding.androiddebugbridge/src/main/resources/OH-INF/thing/thing-types.xml
Show resolved
Hide resolved
Signed-off-by: Miguel <[email protected]>
I can't get rid of the warning in the logs because the library close the connection once the fire stick is offline and I not able to detect this until it throws that exception. Once it throws the binding should change the thing state to offline and the warning should stop spamming. |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Thanks for your patience. I am fine with the current implementation. Improvements and new features can be added later.
Only two final comments because I recognized it in the latest commit. First one is inline. Second one - please review the code of the AndroidDebugBridgeHandler
class because there are some if
-statements without curly brackets.
I am done. 😉
...src/main/java/org/openhab/binding/androiddebugbridge/internal/AndroidDebugBridgeHandler.java
Outdated
Show resolved
Hide resolved
Signed-off-by: Miguel <[email protected]>
Signed-off-by: Miguel <[email protected]>
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
LGTM. Thanks.
@cpmeister Are all your comments addressed?
.../src/main/java/org/openhab/binding/androiddebugbridge/internal/AndroidDebugBridgeDevice.java
Outdated
Show resolved
Hide resolved
.../src/main/java/org/openhab/binding/androiddebugbridge/internal/AndroidDebugBridgeDevice.java
Outdated
Show resolved
Hide resolved
.../src/main/java/org/openhab/binding/androiddebugbridge/internal/AndroidDebugBridgeDevice.java
Outdated
Show resolved
Hide resolved
...java/org/openhab/binding/androiddebugbridge/internal/AndroidDebugBridgeDiscoveryService.java
Outdated
Show resolved
Hide resolved
...java/org/openhab/binding/androiddebugbridge/internal/AndroidDebugBridgeDiscoveryService.java
Outdated
Show resolved
Hide resolved
...src/main/java/org/openhab/binding/androiddebugbridge/internal/AndroidDebugBridgeHandler.java
Outdated
Show resolved
Hide resolved
...src/main/java/org/openhab/binding/androiddebugbridge/internal/AndroidDebugBridgeHandler.java
Show resolved
Hide resolved
...src/main/java/org/openhab/binding/androiddebugbridge/internal/AndroidDebugBridgeHandler.java
Outdated
Show resolved
Hide resolved
...src/main/java/org/openhab/binding/androiddebugbridge/internal/AndroidDebugBridgeHandler.java
Outdated
Show resolved
Hide resolved
...n/java/org/openhab/binding/androiddebugbridge/internal/AndroidDebugBridgeHandlerFactory.java
Outdated
Show resolved
Hide resolved
Signed-off-by: Miguel <[email protected]>
* Initial contribution Signed-off-by: Miguel <[email protected]> Signed-off-by: John Marshall <[email protected]>
* Initial contribution Signed-off-by: Miguel <[email protected]>
* Initial contribution Signed-off-by: Miguel <[email protected]>
Signed-off-by: Miguel [email protected]
Hi openHAB community. I have created this binding to allow openHAB to connect to android devices using the adb protocol.
My motivation for this was to replace some adb commands that I was sending using the exec-binding (to an android device connected to my tv). With the binding I can also avoid to install de adb cli in the docker image and use the official image directly.
I also added some other channels like a player, a volume dimmer, and some to control the application opened. I've been using it for a couple of days and it seems to work correctly.
Hope it can be helpful for others.