Commit graph

42 commits

Author SHA1 Message Date
J. Nick Koston
eced3b0f57
Fix usb scan delaying shutdown (#116390)
If the integration page is accessed right before shutdown it
can trigger the usb scan debouncer which was not marked as
background so shutdown would wait for the scan to finish
2024-04-29 10:07:48 -04:00
J. Nick Koston
ca5ed274cb
Deprecate calling async_listen and async_listen_once with run_immediately (#115169) 2024-04-08 10:07:54 -10:00
Marc Mueller
4d4d2850be
Update pyudev to 0.24.1 (#114359) 2024-03-28 11:01:12 +01:00
J. Nick Koston
412fd3dc05
Add run_immediately to usb start/stop listeners (#113658) 2024-03-17 08:15:14 -10:00
J. Nick Koston
b7f7bed46c
Import and create pyudev for usb in the executor (#113478) 2024-03-15 09:05:18 -10:00
Paulus Schoutsen
f416d67d21
Remove built-in support for import_executor in manifest (#112725) 2024-03-08 12:02:32 -05:00
Marc Mueller
062cc4bfce
Add empty line after module docstring [t-v] (#112705) 2024-03-08 10:35:23 -05:00
J. Nick Koston
f984cca49b
Import usb in the executor to avoid blocking the event loop (#111592)
`2024-02-26 21:38:00.091 DEBUG (MainThread) [homeassistant.loader] Component usb import took 0.753 seconds (loaded_executor=False)`
2024-02-26 18:49:29 -10:00
J. Nick Koston
ff0e0b3e77
Convert debouncer async_shutdown to be a normal function (#111257)
* Convert debouncer async_shutdown to be a normal function

nothing was being awaited here and the shutdown call was only used
in integrations marked internal and other internals. Its possible
that a custom component might have been using the method but it
seemed uncommon enough that it did not warrent marking as a breaking
change. The update coordinator is no longer awaiting anything in
async_shutdown either now but it seemed likely that this use
would get subclassed.

* fix
2024-02-24 08:37:33 +01:00
Erik Montnemery
c8756ba5bb
Use stable USB device path in USB discovery (#94266) 2023-06-08 18:27:04 +02:00
Erik Montnemery
b5f5e1c8c3
Add empty config schema to integrations t-z (#93853) 2023-05-31 10:13:26 +02:00
epenet
9665bc61f2
Fix lingering timer in usb (#91800) 2023-04-21 13:41:22 +02:00
J. Nick Koston
0cc9b2e803
Use slots for discovery dataclasses (#90751) 2023-04-04 12:44:59 +02:00
Erik Montnemery
b0b1d8143f
Sort manifests 10 (#87031) 2023-02-08 20:41:50 +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
epenet
5442d6af01
Improve msg type hint in websocket commands (#80530) 2022-10-18 16:41:17 +02:00
Franck Nijhof
2b27cfdabb
Set system & entity integration types (#79593) 2022-10-04 10:36:42 -04: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
Marc Mueller
5ae5ae5392
Improve debouncer typing (#75436) 2022-07-19 18:35:04 +02:00
Franck Nijhof
80727ff952
Update pyudev to 0.23.2 (#74859) 2022-07-09 20:30:22 -05: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
epenet
ecd43f391f
Prettify json (manifest.json) (#68886) 2022-03-30 10:56:37 +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
da7c5f4722
Break long lines in discovery_info (#61431) 2021-12-10 12:48:47 +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
35c40bcf85
Enable warnings for UsbServiceInfo (#60757)
Co-authored-by: epenet <epenet@users.noreply.github.com>
2021-12-01 05:44:01 -10:00
epenet
cbbf22db52
Use dataclass for UsbServiceInfo (#60140)
Co-authored-by: epenet <epenet@users.noreply.github.com>
2021-11-23 10:51:54 -06:00
epenet
67e13b35db
Revert "Create new usb constants (#60086)" (#60137)
Co-authored-by: epenet <epenet@users.noreply.github.com>
2021-11-22 10:28:10 -06:00
epenet
263101b2ab
Create new usb constants (#60086) 2021-11-21 18:14:42 -06:00
epenet
0dcfd55c84
Adjust async_step_usb signature for strict typing (#59773)
Co-authored-by: epenet <epenet@users.noreply.github.com>
2021-11-16 19:03:50 +01:00
J. Nick Koston
b86e19143d
Prevent event loop delay / instability from discovery (#57463) 2021-10-13 08:37:14 -07: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