Skip to content
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

Is it possible to identify when the device is connected via ADB? #4573

Open
igorsantos07 opened this issue Aug 11, 2024 · 3 comments
Open

Is it possible to identify when the device is connected via ADB? #4573

igorsantos07 opened this issue Aug 11, 2024 · 3 comments
Labels
enhancement New feature or request sensor-tracking

Comments

@igorsantos07
Copy link

Is your feature request related to a problem? Please describe.
A sensor that tells whether the device is being used for debug purposes or not would be useful for "charged enough" automated warnings.

Describe the solution you'd like
A new boolean sensor.

Describe alternatives you've considered, if any
I'll probably use the charger type in place of that, although it's not exactly ideal.

Additional context

I've done some searches and it doesn't seem possible - it looks like the adbd will be in background as soon as you enable USB debugging on the phone, whether it's in use or idle.
But I've opened the issue anyway so at least there's a definitive answer if it's possible or not in HA :)

Thanks for the good work!

@igorsantos07 igorsantos07 added the enhancement New feature or request label Aug 11, 2024
@dshokouhi
Copy link
Member

are you looking to pair this option with another sensor? Not really sure how this can be used for a charged enough automation cant those just use the battery level sensor with fast while charging update interval setting?

anyways seems it is possible but kinda hacky as we need to use an adb command: https://stackoverflow.com/a/14896627

@dshokouhi
Copy link
Member

also in the meantime, use the last notification sensor to detect when the device posts the persistent notification for the connection

@igorsantos07
Copy link
Author

The idea is to not notify when battery reaches 100% if the device is being used for debug (meaning: no way to disconnect it from power).

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
enhancement New feature or request sensor-tracking
Projects
None yet
Development

No branches or pull requests

2 participants