# Plugs URL: /plugs Discover how to use OpenHTF's plugin system to abstract hardware interactions and encapsulate reusable test logic with examples. Manage external hardware and resources with reusable logic. Hardware tests often require connections to external resources like instruments, UUTs, or other softwares. OpenHTF manages these connections through **Plugs**, reusable **classes** that handle resource **initialization**, **control**, and **cleanup**, separating test logic from resource management for easier maintenance and better logging. A plug is a standard Python class that inherits from `BasePlug`. You can then use the `plug` decorator in your test phases to inject the plug. Hardware you connect this way — a multimeter over SCPI, a DUT over a serial port, a PLC over Modbus — has a dedicated guide: PyVISA, pyserial, pymodbus. OpenHTF also ships ready-made plugs for ADB, Fastboot and serial capture. OpenHTF manages the plug's lifecycle automatically: **Instantiation**: At the start of the test, OpenHTF instantiates the plug by calling its `__init__()` method. **Logging**: During the test, the plug can log important actions or events using `self.logger`. **Teardown**: After the test concludes, OpenHTF automatically calls the `tearDown()` method to clean up resources. This ensures reliable cleanup since Python's destructors `__del__()` aren't always called. You can use the `UserInput` plug to prompt the operator during the test. The `text_input` parameter controls the type of interaction - when missing, it defaults to `False` (button prompt). Text shown to the operator, in the console and in the Operator UI. `True` renders a text field; `False` (default) renders an Okay button. Raise `PromptUnansweredError` if the operator does not answer in time. Default: wait forever. URL of an image to show above the prompt in the Operator UI — a photo of the connector to plug, the LED to check. Ignored on the console. ANSI color code for the console prompt (e.g. `colorama.Fore.CYAN`). The `text_input` parameter determines the prompt behavior: `text_input=True`: Displays a text input field where the operator types a response `text_input=False` (default): Displays a button prompt where the operator clicks "Okay" You can define and load configurations specific to a plug, similar to test configurations. You can use `bind_init_args` to create multiple plug instances with variable configurations. This ensures flexible plug setup while maintaining compatibility with OpenHTF's automatic plug lifecycle management.