50 Commits

Author SHA1 Message Date
Franck Nijhof 833ff982d0 Fix line length violations in tests/components t-z (#170994) 2026-05-17 17:12:29 -04:00
puddly c07d176467 Set serial port description from description, not product (#170160)
Co-authored-by: Paulus Schoutsen <balloob@gmail.com>
2026-05-10 22:06:04 -04:00
puddly d2fddf129d Include matching integrations in scanned ports WS API (#169387) 2026-04-28 14:50:31 -04:00
puddly ab08153d62 Expose more port metadata when listing serial ports (#169336) 2026-04-28 07:57:13 -04:00
puddly 8ce14877a4 Register a stub transport for ESPHome serial proxies via USB (#169308) 2026-04-27 15:12:07 -04:00
puddly cb021f0b6b Allow integrations to contribute serial port scanning helpers (#168660)
Co-authored-by: Paulus Schoutsen <paulus@home-assistant.io>
2026-04-21 21:15:57 -04:00
Paulus Schoutsen 69332ed822 Add SerialSelector (#168263) 2026-04-16 10:45:37 +03:00
puddly e3e87185c5 Switch USB integration to list serial ports with serialx (#167615) 2026-04-15 19:22:45 +02:00
puddly b0511519a1 Expose async serial port scanning helper in USB integration (#167706) 2026-04-08 14:29:27 -04:00
puddly 12abff5b9e Allow listing non-USB serial ports with scan_serial_ports (#166029)
Co-authored-by: Paulus Schoutsen <paulus@home-assistant.io>
Co-authored-by: Copilot <175728472+Copilot@users.noreply.github.com>
2026-04-06 14:14:08 -04:00
epenet a308b84f15 Use hardware/usb domain constant in tests (#162934) 2026-02-16 16:39:28 +01:00
epenet 630a9b4896 Cleanup deprecated usb alias (#161748) 2026-01-28 14:04:23 +01:00
puddly 1c0dd02a7c Abort USB discovery flows on device unplug (#156303) 2025-11-26 09:00:41 +01:00
puddly d419dd0c05 Fix non-unique ZHA serial port paths and migrate USB integration to always list unique paths (#155019) 2025-11-04 11:42:56 -05:00
puddly f1e0954c61 Automatically setup hardware integrations when firmware info is published by an integration (#154030) 2025-10-13 16:26:01 +02:00
puddly a219445751 Add helper methods to simplify USB integration testing (#141733)
* Add some helper methods to simplify USB integration testing

* Re-export `usb_device_from_port`
2025-03-29 11:26:37 -10:00
J. Nick Koston 3d7e3590d4 Migrate usb to use aiousbwatcher (#136676)
* Migrate usb to use aiousbwatcher

aiousbwatcher uses inotify on /dev/bus/usb to look for devices
added and being removed which works on a lot more systems

* bump asyncinotify

* bump aiousbwatcher to 1.1.1

* tweaks

* tweaks

* tweaks

* fixes

* debugging

* Update homeassistant/components/usb/__init__.py

* Update homeassistant/components/usb/__init__.py

---------

Co-authored-by: Paulus Schoutsen <balloob@gmail.com>
2025-01-28 09:57:11 -05:00
puddly 9b66ba61a8 USB device add/remove callbacks (#131224) 2025-01-16 11:53:15 -10:00
puddly 9331b1572c Implement a polling fallback for USB monitor (#130918) 2025-01-16 11:14:53 -10:00
epenet e83ee00af8 Move UsbServiceInfo to service_info helpers (#135663)
* Move UsbServiceInfo to service_info helpers

* Adjust components
2025-01-15 15:10:25 +01:00
puddly bd65afa207 Prioritize the correct CP2102N serial port on macOS (#116461) 2024-06-22 18:37:55 +02:00
epenet ea571a6997 Fix unnecessary-dunder-call pylint warnings in tests (#119379) 2024-06-11 16:18:16 +02:00
epenet e57bac6da8 Fix confusing-with-statement pylint warnings (#119364) 2024-06-11 15:03:03 +02:00
puddly 380f192c93 Expose the SkyConnect integration with a firmware config/options flow (#115363)
Co-authored-by: Stefan Agner <stefan@agner.ch>
Co-authored-by: Martin Hjelmare <marhje52@gmail.com>
Co-authored-by: Erik <erik@montnemery.com>
2024-04-24 17:06:24 +02:00
Joost Lekkerkerker 6bb4e7d62c Bump ruff to 0.3.4 (#112690)
Co-authored-by: Sid <27780930+autinerd@users.noreply.github.com>
Co-authored-by: Marc Mueller <30130371+cdce8p@users.noreply.github.com>
Co-authored-by: J. Nick Koston <nick@koston.org>
2024-03-26 00:02:16 +01:00
J. Nick Koston b7f7bed46c Import and create pyudev for usb in the executor (#113478) 2024-03-15 09:05:18 -10:00
Marc Mueller aa16a9d707 Add empty line after module docstring (3) (#112750) 2024-03-08 20:38:34 +01:00
Marc Mueller 32f3f46542 Add empty line after module docstring (2) [tests.components] (#112737) 2024-03-08 19:16:21 +01:00
Aarni Koskela 706add4a57 Switch formatting from black to ruff-format (#102893)
Co-authored-by: Franck Nijhof <git@frenck.dev>
2023-11-27 14:38:59 +01:00
Erik Montnemery c8756ba5bb Use stable USB device path in USB discovery (#94266) 2023-06-08 18:27:04 +02:00
epenet aa50096a31 Add type hints to integration tests (part 24) (#88307) 2023-02-17 16:34:53 +01:00
epenet 278050a73f Add type hints to integration tests (t-z) (#87707) 2023-02-08 19:10:53 +01:00
epenet 4142f0d15d Add return type to tests without arguments (#87613)
* Add return type to tests without arguments

* Black

* Cancel fixture amends
2023-02-07 14:20:06 +01:00
Erik Montnemery affea9a305 Remove sky connect config entry if USB stick is not plugged in (#85765)
* Remove sky connect config entry if USB stick is not plugged in

* Tweak cleanup

* Give some stuff more cromulent names

* Do the needful

* Add tests

* Tweak
2023-01-16 09:25:06 +01:00
puddly 3788a950e6 Validate matcher field case in usb.async_is_plugged_in (#81514)
* Support case-insensitive matching

* Revert "Support case-insensitive matching"

This reverts commit 0fdb2aa6bc.

* Explicitly check the case of matcher fields in `async_is_plugged_in`
2022-11-07 17:14:57 +01:00
J. Nick Koston c76dec138a Discover new bluetooth adapters when they are plugged in (#77006) 2022-08-22 15:45:08 -10:00
Erik Montnemery bb74730e96 Add support for USB dongles to the hardware integration (#76795)
* Add support for USB dongles to the hardware integration

* Update hardware integrations

* Adjust tests

* Add USB discovery for SkyConnect 1.0

* Improve test coverage

* Apply suggestions from code review

Co-authored-by: Paulus Schoutsen <balloob@gmail.com>

* Fix frozen dataclass shizzle

* Adjust test

Co-authored-by: Paulus Schoutsen <balloob@gmail.com>
2022-08-18 21:52:12 +02:00
epenet 141688e210 Cleanup ServiceInfo compatibility (#60540)
Co-authored-by: epenet <epenet@users.noreply.github.com>
Co-authored-by: J. Nick Koston <nick@koston.org>
2022-05-09 14:17:48 +02:00
J. Nick Koston ad87d06d1f Enable strict typing for usb (#67466)
* Enable strict typing for usb

* Enable strict typing for usb

* Enable strict typing for usb

* adjust

* coverage

* Update tests/components/usb/test_init.py
2022-03-03 07:59:31 +01:00
epenet c05eca1c82 Remove log flooding prevention logic from discovery info (#61243)
Co-authored-by: epenet <epenet@users.noreply.github.com>
2021-12-08 10:28:26 -10:00
epenet 2fe0382841 Add compatibility tests for UsbServiceInfo (#60753)
Co-authored-by: epenet <epenet@users.noreply.github.com>
2021-12-01 05:43:31 -10:00
J. Nick Koston 673519f6bf Prefer more targeted matchers in USB discovery (#56142)
- If there is a more targeted match it should win discovery
2021-09-12 15:07:40 -07:00
Pascal Vizeli 8319f232b8 Disable observer for USB on containers (#55570)
* Disable observer for USB on containers

* remove operating system test

Co-authored-by: J. Nick Koston <nick@koston.org>
2021-09-03 08:05:37 +02:00
J. Nick Koston dfc2556669 Gracefully handle pyudev failing to filter on WSL (#55286)
* Gracefully handle pyudev failing to filter on WSL

* add debug message

* add mocks so we reach the new check
2021-08-26 15:47:10 -05:00
J. Nick Koston a89057ece5 Limit USB discovery to specific manufacturer/description/serial_number matches (#55236)
* Limit USB discovery to specific manufacturer/description/serial_number matches

* test for None case
2021-08-26 09:59:02 -04:00
J. Nick Koston b6a1153d42 Skip trying the pyudev observer when using standalone docker for usb (#54987) 2021-08-22 11:30:35 -05:00
J. Nick Koston 42f7f19be5 Switch periodic USB scanning to on-demand websocket when observer is not available (#54953) 2021-08-21 16:06:44 -05:00
J. Nick Koston 51434c5faa Gracefully handle udev not available via OSError when setting up usb (#54967) 2021-08-21 07:24:45 -05:00
J. Nick Koston c609236a63 Move get_serial_by_id and human_readable_device_name to usb (#54968) 2021-08-21 07:24:21 -05:00
J. Nick Koston dc74a52f58 Add support for USB discovery (#54904)
Co-authored-by: Martin Hjelmare <marhje52@gmail.com>
2021-08-20 14:04:18 -05:00