[Python] How to disable USB charging when phone is connected and no USB lock

Discussão em 'Python' iniciado por Stack, Agosto 11, 2025.

  1. Stack

    Stack Membro Participativo

    Background:

    Connecting a computer(windows11) and phone via USB

    What I want to do:

    Control disconnecting the USB connection using a Python script

    What I've tried

    Disabling the USB port and setting a charging stop using Python's devcon

    Experimental results:

    The mobile device has a USB lock and cannot sleep. My question: How to disable USB charging when phone is connected and no USB lock

    Continue reading...

Compartilhe esta Página