Commit Graph
106 Commits
Author SHA1 Message Date
J. Nick KostonandGitHub 4cebc767b5 Give users a hint that their bluetooth adapter has been ignored (#87727) 2023-02-09 16:41:53 -06:00
epenetandGitHub 807c69f621 Add type hints to integration tests (b-c) (#87698) 2023-02-08 18:08:43 +01:00
Franck NijhofandGitHub 5e81d28116 Update black to 23.1.0 (#87188) 2023-02-02 18:35:24 +01:00
Franck NijhofandGitHub 3b5fd4bd06 Enable Ruff TRY004 (#86811) 2023-01-30 14:06:52 +01:00
J. Nick KostonandGitHub d0c7f42559 Fix Bluetooth discoveries missing between restarts (#86808)
* Fix Bluetooth discoveries missing between restarts

* do not load other integrations

* coverage
2023-01-27 22:16:16 -05:00
Marc MuellerandGitHub 4f87c1f30f Update pre-commit-config [Py310] (#86415) 2023-01-23 09:59:44 +01:00
Franck NijhofandGitHub 24fdd588fd Code styling tweaks to the tests - Part 1 (#86192) 2023-01-20 13:52:46 +01:00
Aarni KoskelaandGitHub 40d39a15c9 Fix stray string literal in bluetooth test wrapper (#86228) 2023-01-19 14:53:43 +01:00
MichaelandGitHub 2850583085 Replace the usage of unit constants by enumerations in Tests [a-e] (#85932) 2023-01-15 14:44:01 +01:00
42a4dd98f1 Use fallback advertising interval for non-connectable Bluetooth devices (#85701)
Co-authored-by: J. Nick Koston <nick@koston.org>
2023-01-11 12:11:25 -10:00
David BuezasandGitHub 112b2c22f7 Expose async_scanner_devices_by_address from the bluetooth api (#83733)
Co-authored-by: J. Nick Koston <nick@koston.org>
fixes undefined
2023-01-08 14:06:32 -10:00
J. Nick KostonandGitHub 8c70e5aaad Try the next best adapter after a BLE connection fails (#84512)
* Try the next best adapter after a BLE connection fails

* add cover

* tweak

* tweak

* Update homeassistant/components/bluetooth/wrappers.py

* bump

* small tweak

* tweak logic
2022-12-23 20:48:47 -05:00
J. Nick KostonandGitHub 070aa714a0 Switch to a different local Bluetooth adapter when one runs out of connection slots (#84331) 2022-12-23 08:58:33 -10:00
J. Nick KostonandGitHub 53363cf7e8 Implement an active update coordinator for polling ble devices that get data from both advertisements and active connections (#84207) 2022-12-19 16:09:29 -10:00
J. Nick KostonandGitHub bb3feceb57 Fix connectable Bluetooth devices not going available after scanner recovers (#84172) 2022-12-19 13:37:29 +01:00
J. Nick KostonandGitHub 9f10bd46ac Rename Bluetooth active_update_coordinator to active_update_processor (#84115) 2022-12-16 22:25:43 -10:00
J. Nick KostonandGitHub 0e2ebfe5c4 Move bluetooth watchdog into the scanner base class (#83888) 2022-12-13 11:57:40 -10:00
J. Nick KostonandGitHub 80a8d5443d Improve remote bluetooth scanner diagnostics and add missing test cover (#83796) 2022-12-11 21:33:30 -10:00
J. Nick KostonandGitHub 9008006ac8 Restore remote discovered devices between remote scanner restarts (#83699) 2022-12-11 09:02:55 -10:00
Erik MontnemeryandGitHub c4afc33fc5 Add abc.ABC to classes with abstract methods (#83546) 2022-12-08 17:50:36 +01:00
J. Nick KostonandGitHub 955d4abf13 Fix missing services with esp32 proxies (#83192) 2022-12-03 13:50:59 -05:00
J. Nick KostonandGitHub a28214caec Fix bluetooth remote connections not picking the best path (#82957) 2022-11-29 19:56:31 -10:00
J. Nick KostonandGitHub 46b18367f7 Send back BLE address type when connecting via esphome proxies (#82890) 2022-11-28 18:54:53 -10:00
d6e287f47a Add manufacturer and model to bluetooth adapter device (#82769)
Co-authored-by: Paulus Schoutsen <balloob@gmail.com>
2022-11-27 15:44:44 -05:00
J. Nick KostonandGitHub f0ae1cc6ce Add bluetooth diagnostics to esphome (#82761) 2022-11-27 14:59:37 -05:00
Aarni KoskelaandGitHub e4c73259f7 Configure autoflake for pre-commit (#82414) 2022-11-22 08:10:36 +01:00
J. Nick KostonandGitHub a7caa038be Accept advertisements from alternate scanners when a scanner stops scanning (#82448) 2022-11-21 21:23:07 -05:00
J. Nick KostonandGitHub 3f5649092e Break out bluetooth apis into api.py (#82416)
* Break out bluetooth apis into api.py

Like #82291 this is not a functional change.

* cleanups
2022-11-20 12:33:03 -05:00
J. Nick KostonandGitHub 7801cd96de Split bluetooth models into base_scanner and wrappers (#82291) 2022-11-20 08:44:28 -06:00
J. Nick KostonandGitHub 47c66dbed4 Offload platform specific bluetooth code to bluetooth-adapters (#82196)
* Offload platform specific bluetooth code to bluetooth-adapters

* adjust

* fix some more patch targets

* more test fixes

* almost there

* may not be setup yet

* more fixes

* fixes

* fix test

* fix merge
2022-11-17 14:34:19 -05:00
J. Nick KostonandGitHub 682187541f Move BluetoothServiceInfoBleak to home_assistant_bluetooth (#82064) 2022-11-15 14:00:52 -06:00
J. Nick KostonandGitHub f584efa0c2 Move bluetooth remote scanner implementation into a base class (#82012) 2022-11-13 14:18:36 -06:00
J. Nick KostonandGitHub 78180b2ad8 Fix bluetooth adapters with missing firmware patch files not being discovered (#81926) 2022-11-10 14:14:37 -06:00
J. Nick KostonandGitHub ab14e55c05 Ensure we do not actually create a BleakScanner in the usage test (#81362)
Avoids a failure when bluetooth is turned off when
testing on macos:

bleak.exc.BleakError: Bluetooth device is turned off
2022-11-02 14:57:59 +01:00
J. Nick KostonandGitHub 5b09ab93dc Immediately prefer advertisements from alternate sources when a scanner goes away (#81357) 2022-11-01 13:07:03 -04:00
J. Nick KostonandGitHub 03362bec1c Defer bluetooth scanner watchdog restart if one is already in progress (#80679) 2022-10-20 13:56:20 -05:00
c4bbc439a5 Integrations v2.1: Differentiating hubs, devices and services (#80524)
Co-authored-by: Paulus Schoutsen <balloob@gmail.com>
2022-10-19 12:41:43 +02:00
J. Nick KostonandGitHub f70f972d88 Fix connectable Bluetooth devices not being seen if the nearest scanner is non-connectable (#80388)
If we saw the non-connectable scanner advertisement first we would reject
the connectable scanner advertisement because it had worse signal strength.

In this case we need to check both
2022-10-17 21:13:26 -04:00
Joakim PlateandGitHub 9eb4faf037 Fire bluetooth listener for all matching devices (#80440)
* Fire listener for all matching devices

* Add test case for seen device

* Avoid looping all data if we have address match

* Initialize to empty list
2022-10-16 21:49:12 +02:00
J. Nick KostonandGitHub d12cbab6c4 Bump bleak to 0.19.0 (#80349) 2022-10-15 13:57:23 -04:00
J. Nick KostonandGitHub 0c76e3a97e Automatically determine the advertising interval for bluetooth devices (#79669) 2022-10-14 14:39:18 -04:00
J. Nick KostonandGitHub c798723c27 Fix bluetooth diagnostics on macos (#79680)
* Fix bluetooth diagnostics on macos

The pyobjc objects cannot be pickled which cases dataclasses
asdict to raise an exception when trying to do the deepcopy

We now implement our own as_dict to avoid this problem

* add cover
2022-10-06 04:32:29 +02:00
J. Nick KostonandGitHub 2768b2445a Remove call to deprecated bleak register_detection_callback (#79558) 2022-10-03 21:15:09 -04:00
J. Nick KostonandGitHub 5eb50f63fd Ensure bleak_retry_connector uses HaBleakClientWrapper (#79132) 2022-09-27 14:06:10 -04:00
J. Nick KostonandGitHub 75f6f9b5e2 Improve performance of Bluetooth device fallback (#79078) 2022-09-26 09:12:08 -04:00
J. Nick KostonandGitHub 1b144c0e4d Update to bleak 0.18.0 (#79008) 2022-09-23 15:09:28 -10:00
J. Nick KostonandGitHub d1da6ea04d Fix flapping bluetooth scanner test (#78961) 2022-09-22 23:39:38 -04:00
J. Nick KostonandGitHub 488b04fc8b Handle default RSSI values from bleak in bluetooth (#78908) 2022-09-21 17:03:50 -04:00
12856dea05 Create an issue when Bluetooth is active on old HAOS (#78430)
Co-authored-by: Paulus Schoutsen <paulus@home-assistant.io>
2022-09-19 21:02:13 -04:00
J. Nick KostonandGitHub caba202efa Fix failing bluetooth tests (#78757) 2022-09-19 20:59:27 -04:00