Commit Graph

457 Commits (5d231ed61f82ecbe556d920d5244caa4cb1e4dc4)

Author SHA1 Message Date
J. Nick Koston a3dd2b8ea9
Migrate to using faster monotonic_time_coarse from bluetooth-data-tools (#104882) 2023-12-01 10:57:09 -10:00
J. Nick Koston 970751a635
Bump bluetooth-data-tools to 0.16.0 (#104854) 2023-12-01 04:44:58 -07:00
J. Nick Koston b94c9c8f6d
Bump bluetooth-data-tools to 1.15.0 (#104480)
changelog: https://github.com/Bluetooth-Devices/bluetooth-data-tools/compare/v1.14.0...v1.15.0
2023-11-25 08:21:25 +01:00
J. Nick Koston d3b4dd226b
Prevent Bluetooth reconnects from blocking shutdown (#104150) 2023-11-19 08:22:26 -06:00
J. Nick Koston e7cec9b148
Small speed up to constructing Bluetooth service_uuids (#104193) 2023-11-19 08:14:55 -06:00
J. Nick Koston 253e6188eb
Bump dbus-fast to 2.14.0 (#103754) 2023-11-10 17:11:41 +01:00
J. Nick Koston 23578d8046
Bump dbus-fast to 2.13.1 (#103621)
* Bump dbus-fast to 2.13.0

changelog: https://github.com/Bluetooth-Devices/dbus-fast/compare/v2.12.0...v2.13.0

* no change re-release since upload failed due to running out of space on pypi
2023-11-07 19:42:53 -06:00
J. Nick Koston 8ef3cf2e18
Bump bluetooth-data-tools to 0.14.0 (#103413)
changelog: https://github.com/Bluetooth-Devices/bluetooth-data-tools/compare/v1.13.0...v1.14.0
2023-11-05 07:07:44 -06:00
J. Nick Koston 5bcff82148
Remove useless inner function in the base Bluetooth coordinator (#103305)
Remove unless inner function in the base Bluetooth coordinator
2023-11-03 15:41:47 +01:00
J. Nick Koston c81ada16ba
Add debug logging for which adapter is used to connect bluetooth devices (#103264)
Log which adapter is used to connect bluetooth devices

This is a debug logging improvement to help users find problems
with their setup
2023-11-03 07:35:51 +01:00
Jan-Philipp Benecke 43915fbaf3
Add connections to PassiveBluetoothProcessorEntity (#102854) 2023-10-27 12:09:59 +02:00
J. Nick Koston b89e7a2fe2
Bump bleak-retry-connector to 3.3.0 (#102825)
changelog: https://github.com/Bluetooth-Devices/bleak-retry-connector/compare/v3.2.1...v3.3.0
2023-10-25 23:23:06 -04:00
Erik Montnemery 64f0ea60d1
Correct logic for picking bluetooth local name (#102823)
* Correct logic for picking bluetooth local name

* make test more robust

---------

Co-authored-by: J. Nick Koston <nick@koston.org>
2023-10-25 18:08:31 -05:00
J. Nick Koston b3bd34a024
Avoid dispatching same state to passive bluetooth entities (#102430) 2023-10-22 14:08:28 +02:00
J. Nick Koston 51596c6231
Remove useless freezing on PassiveBluetoothDataUpdate (#102434) 2023-10-21 10:07:02 -10:00
J. Nick Koston f9dbddc884
Small cleanups to Bluetooth fallback intervals (#102440) 2023-10-21 10:06:49 -10:00
J. Nick Koston 89f9d64bf5
Add early return check to passive Bluetooth entities listener (#102435) 2023-10-21 10:06:39 -10:00
J. Nick Koston 22de378d91
Bump bluetooth-data-tools to 1.13.0 (#102208) 2023-10-18 08:54:17 -10:00
J. Nick Koston d0bff10502
Bump dbus-fast to 2.12.0 (#102206) 2023-10-18 07:14:13 -10:00
J. Nick Koston c951c03447
Bump dbus-fast to 2.11.1 (#101406)
changelog: https://github.com/Bluetooth-Devices/dbus-fast/compare/v2.11.0...v2.11.1
2023-10-04 21:01:10 -04:00
J. Nick Koston b21451b3d1
Bump dbus-fast to 2.11.0 (#101005) 2023-09-27 10:23:06 -05:00
Raman Gupta 067b94899f
Move EVENT_LOGGING_CHANGED to constants (#100974)
* Move EVENT_LOGGING_CHANGED to constants

* fix test

* remove logger as dependency for bluetooth and fix test
2023-09-27 01:06:14 -04:00
J. Nick Koston 667f4b1ca8
Mark Bluetooth scanner as not scanning when watchdog timeout is reached (#100738) 2023-09-26 05:29:46 -05:00
J. Nick Koston dbdc513aa5
Bump dbus-fast to 2.10.0 (#100879) 2023-09-25 16:19:03 -05:00
J. Nick Koston b9e8566608
Bump bluetooth-data-tools to 0.12.0 (#100794) 2023-09-24 20:29:29 +02:00
Jc2k f0375eb97e
Expose bluetooth availability tracking interval controls to integrations (#100774) 2023-09-24 10:45:25 +02:00
J. Nick Koston 8b5129a7d9
Bump dbus-fast to 2.9.0 (#100638) 2023-09-20 13:58:34 +02:00
J. Nick Koston df74ed0d40
Bump bleak-retry-connector to 3.2.1 (#100377) 2023-09-14 15:13:15 -05:00
J. Nick Koston d8d756dd7d
Bump dbus-fast to 2.7.0 (#100321) 2023-09-13 14:33:42 -05:00
J. Nick Koston e8ed4c1ace
Bump dbus-fast to 2.6.0 (#100163)
changelog: https://github.com/Bluetooth-Devices/dbus-fast/compare/v2.4.0...v2.6.0
2023-09-12 08:56:02 +02:00
J. Nick Koston 140af44e31
Bump dbus-fast to 2.4.0 (#100158) 2023-09-11 21:40:32 -05:00
J. Nick Koston 80e05716c0
Bump dbus-fast to 2.2.0 (#100076) 2023-09-10 16:38:39 -05:00
Jan Bouwhuis 6899245020
Use hass.loop.create_future() for bluetooth (#100054) 2023-09-10 17:16:16 +02:00
J. Nick Koston aff49cb67a
Bump bluetooth-auto-recovery to 1.2.3 (#99979)
fixes #99977
2023-09-09 19:23:15 +02:00
J. Nick Koston f903cd6fc0
Bump dbus-fast to 2.0.1 (#99894) 2023-09-08 21:16:21 -05:00
J. Nick Koston 694638cbc0
Bump bleak to 0.21.1 (#99960) 2023-09-08 19:39:30 -05:00
J. Nick Koston 8742c550be
Upgrade bluetooth deps to fix timeout behavior on py3.11 (#99879) 2023-09-08 13:25:25 +02:00
J. Nick Koston 54bd7c9af0
Bump dbus-fast to 1.95.2 (#99852) 2023-09-07 13:27:29 -05:00
J. Nick Koston 533350b94a
Bump dbus-fast to 1.95.0 (#99749) 2023-09-06 13:21:21 -05:00
J. Nick Koston 63273a307a
Fix Bluetooth passive update processor dispatching updates to unchanged entities (#99527)
* Fix passive update processor dispatching updates to unchanged entities

* adjust tests

* coverage

* fix

* Update homeassistant/components/bluetooth/update_coordinator.py
2023-09-04 20:42:05 -04:00
J. Nick Koston d063650fec
Bump bleak-retry-connector to 3.1.2 (#99540) 2023-09-03 09:13:21 -05:00
J. Nick Koston 8843a445c9
Reduce Bluetooth coordinator/processor overhead (#99526) 2023-09-03 08:59:15 -05:00
J. Nick Koston 00893bbf14
Bump bleak to 0.21.0 (#99520)
Co-authored-by: Martin Hjelmare <marhje52@gmail.com>
2023-09-03 08:22:03 -05:00
Jc2k e465a4f820
Update bluetooth-data-tools to 1.11.0 (#99485) 2023-09-01 17:33:19 -05:00
J. Nick Koston 6cd28b64e8
Bump bluetooth-data-tools 1.9.1 (#99131) 2023-08-27 10:10:00 -05:00
J. Nick Koston 5cc49f6dd6
Bump dbus-fast to 1.94.1 (#99132) 2023-08-27 09:27:30 -05:00
J. Nick Koston 3ebf96143a
Improve performance of bluetooth coordinators (#98997) 2023-08-25 10:31:43 +02:00
J. Nick Koston 53eb4d0ead
Bump dbus-fast to 1.94.0 (#98973) 2023-08-24 11:10:38 -05:00
J. Nick Koston 46a0f84101
Bump bluetooth-data-tools to 1.9.0 (#98927) 2023-08-23 20:18:21 -05:00
Ville Skyttä 3b4774d9ed
Remove unnnecessary pylint configs from components/[a-d]* (#98911) 2023-08-24 00:54:02 +02:00
J. Nick Koston 6023ee0cc4
Bump dbus-fast to 1.93.0 (#98758) 2023-08-21 19:08:26 +02:00
Ville Skyttä 3094991236
Upgrade ruff to 0.0.285 (#98647) 2023-08-19 08:17:17 -04:00
J. Nick Koston f318063a77
Bump dbus-fast to 1.92.0 (#98656) 2023-08-19 06:13:22 -05:00
J. Nick Koston d3ee2366b0
Bump dbus-fast to 1.91.4 (#98600) 2023-08-18 03:09:15 -05:00
Marc Mueller a9ade1f84d
Use asyncio.timeout [core] (#98447) 2023-08-15 08:36:05 -05:00
J. Nick Koston 262483f3f6
Replace async_timeout with asyncio.timeout A-B (#98415) 2023-08-15 10:29:28 +02:00
Marc Mueller fb66ceb302
Update mypy to 1.5.0 (#98179) 2023-08-11 13:13:04 +02:00
Erik Montnemery 045c327928
Move DeviceInfo from entity to device registry (#98149)
* Move DeviceInfo from entity to device registry

* Update integrations
2023-08-10 22:04:26 -04:00
J. Nick Koston 108bcabf75
Add missing transmit power to ESPHome Bluetooth scanners (#98175)
We did not previously have a way to get the transmit power value when using
ESPHome scanners. bluetooth-data-tools 1.8.0 includes it in the
advertisment tuple to fully align with the bleak implementation.

txpower is not yet used in the HA codebase but may be expected by
upstream libaries that calculate estimated distance
2023-08-10 21:59:37 -04:00
Franck Nijhof 868a5f377f
Ruff: isort don't split imports based on trailing comma (#98162) 2023-08-10 14:27:03 +02:00
J. Nick Koston e05b74668c
Bump dbus-fast to 1.91.2 (#98105) 2023-08-09 20:31:57 -10:00
J. Nick Koston 56257b7a38
Restore passive bluetooth entity data at startup (#97462) 2023-08-06 20:25:18 -10:00
J. Nick Koston c478a81deb
Bump bluetooth-data-tools to 1.7.0 (#97821) 2023-08-05 22:21:46 +02:00
J. Nick Koston 9980051c3a
Bump dbus-fast to 1.90.1 (#97619)
* Bump dbus-fast to 1.88.0

- cython 3 fixes
- performance improvements

changelog: https://github.com/Bluetooth-Devices/dbus-fast/compare/v1.87.5...v1.88.0

* one more

* Bump dbus-fast to 1.90.0

* bump again for yet another round of cython3 fixes
2023-08-03 14:33:05 +03:00
J. Nick Koston 7e134a3d44
Cleanups to the Bluetooth processor coordinators (#97546) 2023-08-01 10:27:25 +02:00
J. Nick Koston 37cdd51183
Combine Bluetooth update coordinator subscriptions to reduce code duplication (#97503) 2023-07-31 01:03:19 -07:00
J. Nick Koston 5c4e47c127
Use internal imports in Bluetooth update coordinator to avoid future circular imports (#97506) 2023-07-31 01:02:57 -07:00
J. Nick Koston f218fb8cee
Fix typo in PassiveBluetoothDataProcessor (#97508) 2023-07-31 08:56:30 +02:00
J. Nick Koston 84576672de
Bump dbus-fast to 1.87.5 (#97364) 2023-07-30 18:39:40 +02:00
J. Nick Koston 6ae79524bd
Add support for bleak 0.21 (#97212) 2023-07-25 19:30:54 +02:00
J. Nick Koston 213a1690f3
Bump bleak-retry-connector to 3.1.1 (#97218) 2023-07-25 19:21:11 +02:00
J. Nick Koston bb0727ab8a
Bump home-assistant-bluetooth to 1.10.2 (#97193) 2023-07-25 05:20:03 -05:00
J. Nick Koston 410b343ae0
Bump dbus-fast to 1.87.2 (#97167) 2023-07-24 14:48:18 -05:00
J. Nick Koston 593960c704
Bump bluetooth deps (#97157) 2023-07-24 19:49:24 +02:00
J. Nick Koston f310d6ca58
Bump bleak-retry-connector to 3.1.0 (#96917) 2023-07-19 17:04:46 -05:00
J. Nick Koston c86b60bdf7
Bump bluetooth-data-tools to 1.6.0 (#96461) 2023-07-13 11:42:11 -10:00
Paulus Schoutsen 7859be6481
Add deduplicate translations script (#96384)
* Add deduplicate script

* Fix forecast_solar incorrect key with space

* Fix utf-8

* Do not create references to other arbitrary other integrations

* Add commented code to only allow applying to referencing integrations

* Tweak

* Bug fix

* Add command line arg for limit reference

* never suggest to update common keys

* Output of script

* Apply suggestions from code review

Co-authored-by: Michael <35783820+mib1185@users.noreply.github.com>

---------

Co-authored-by: Michael <35783820+mib1185@users.noreply.github.com>
2023-07-13 11:52:50 -04:00
J. Nick Koston c67a1a326f
Improve chances of recovering stuck down bluetooth adapters (#96382) 2023-07-12 06:39:32 -10:00
J. Nick Koston e8397063d3
Optimize bluetooth base scanners for python3.11+ (#96165) 2023-07-09 12:56:33 -10:00
J. Nick Koston bc28d7f33e
Add slots to bluetooth manager (#95881) 2023-07-09 10:06:26 -10:00
J. Nick Koston 93b4e6404b
Bump bluetooth-data-tools to 1.3.0 (#95576) 2023-06-29 18:03:59 -05:00
J. Nick Koston 54255331d5
Small cleanups to bluetooth manager advertisement processing (#95453)
Avoid a few lookups that are rarely used now
2023-06-28 21:40:03 -04:00
Marc Mueller 6033f39a0d
Partial revert "Add TypeVar defaults for DataUpdateCoordinator (#95026)" (#95101)
* Revert "Add TypeVar defaults for DataUpdateCoordinator and EntityComponent (#95026)"

This reverts commit 90f5b1c323.

* Don't revert everything
2023-06-23 14:42:34 +02:00
J. Nick Koston 1459bf4011
Fix async_scanner_devices_by_address unexpectedly combining Bluetooth scanners (#94990) 2023-06-22 16:50:21 +02:00
Marc Mueller 90f5b1c323
Add TypeVar defaults for DataUpdateCoordinator and EntityComponent (#95026) 2023-06-22 03:33:23 +02:00
J. Nick Koston 7e3510800d
Bump bluetooth-data-tools to 1.2.0 (#94696)
changelog: https://github.com/Bluetooth-Devices/bluetooth-data-tools/compare/v1.1.0...v1.2.0

benchmark (0.4.0) currently in 2023.6.x: Parsing 100000 bluetooth messages took 8.928823958034627 seconds
benchmark (1.2.0) this PR: Parsing 100000 bluetooth messages took 1.6808899159659632 seconds
2023-06-15 22:11:14 -04:00
J. Nick Koston 2a5ffa9a5b
Fix timestamps for bluetooth scanners that bundle advertisements (#94511)
#94138 added support for raw/bundled advertisements. We should use the
same monotonic time for all advertisements in the bundle if not time
is passed, or calculate the timestamp and pass it if its known
2023-06-14 21:47:00 -04:00
J. Nick Koston b149fffa08
Bump bluetooth-data-tools to 1.1.0 (#94610)
Bume bluetooth-data-tools to 1.1.0

performance improvements

https://github.com/Bluetooth-Devices/bluetooth-data-tools/compare/v1.0.0...v1.1.0
2023-06-14 22:25:26 +02:00
J. Nick Koston 223394eaee
Bump bluetooth-data-tools to 1.0.0 (#94145) 2023-06-13 06:42:10 -10:00
J. Nick Koston 17d1c0733d
Remove outdated HAOS check from bluetooth (#93809) 2023-05-30 19:41:51 +02:00
Erik Montnemery 8053073a77
Add empty config schema to integrations a-c (#93608) 2023-05-29 14:38:33 -04:00
J. Nick Koston bf2cfb8edf
Bump bluetooth-auto-recovery to 1.2.0 (#92893) 2023-05-11 08:58:29 +02:00
J. Nick Koston f47f49c9a1
Reduce overhead to check bluetooth logging (#92512) 2023-05-07 01:30:54 +02:00
J. Nick Koston 36cb8a7184
Bump bluetooth-auto-recovery 1.1.2 (#92495)
Improve handling when getting the power state times out

https://github.com/Bluetooth-Devices/bluetooth-auto-recovery/compare/v1.1.1...v1.1.2
2023-05-04 09:53:43 -04:00
J. Nick Koston 5ee6595998
Bump dbus-fast to 1.86.0 (#92435) 2023-05-04 12:24:26 +02:00
J. Nick Koston 4abf0ddeb9
Bump bluetooth-auto-recovery to 1.1.1 (#92412)
* Bump bluetooth-auto-recovery to 1.1.0

https://github.com/Bluetooth-Devices/bluetooth-auto-recovery/releases/tag/v1.1.0

In https://github.com/home-assistant/operating-system/issues/2485 is was discovered that a more aggressive reset strategy is needed due to a yet unsolved bug in the linux 6.1.x kernel series

* bump to 1.1.1 since event 47 cannot be decoded (newer kernels only)
2023-05-03 12:18:47 -04:00
J. Nick Koston b629bf37bb
Bump bleak to 0.20.2 (#92294) 2023-04-30 17:07:00 +02:00
J. Nick Koston 6b931b208f
Small cleanups to bluetooth internals (#92045)
* Small cleanups to bluetooth internals

Improve the performance of _async_on_advertisement

Fixes

```
tests/components/bluetooth/test_models.py::test_ble_device_with_proxy_client_out_of_connections_uses_best_available
tests/components/bluetooth/test_models.py::test_ble_device_with_proxy_client_out_of_connections_uses_best_available_macos
  /Users/bdraco/home-assistant/homeassistant/components/bluetooth/wrappers.py:226: FutureWarning: This method will be removed future version, pass the callback to the BleakClient constructor instead.
    self._backend.set_disconnected_callback(

tests/components/bluetooth/test_models.py::test_ble_device_with_proxy_client_out_of_connections_uses_best_available_macos
  /Users/bdraco/home-assistant/tests/components/bluetooth/test_models.py:506: FutureWarning: BLEDevice.metadata is deprecated and will be removed in a future version of Bleak, use AdvertisementData instead
    switchbot_proxy_device_no_connection_slot.metadata["delegate"] = 0

tests/components/bluetooth/test_models.py::test_ble_device_with_proxy_client_out_of_connections_uses_best_available_macos
  /Users/bdraco/home-assistant/tests/components/bluetooth/test_models.py:521: FutureWarning: BLEDevice.metadata is deprecated and will be removed in a future version of Bleak, use AdvertisementData instead
    switchbot_proxy_device_has_connection_slot.metadata["delegate"] = 0

tests/components/bluetooth/test_models.py::test_ble_device_with_proxy_client_out_of_connections_uses_best_available_macos
  /Users/bdraco/home-assistant/tests/components/bluetooth/test_models.py:535: FutureWarning: BLEDevice.metadata is deprecated and will be removed in a future version of Bleak, use AdvertisementData instead
    switchbot_device.metadata["delegate"] = 0

```

* put back kwargs
2023-04-26 11:16:34 +02:00
J. Nick Koston 2e18b37291
Bump dbus-fast to 1.85.0 (#91784) 2023-04-21 08:26:44 +02:00
epenet 62d38b49bc
Fix lingering timers in bluetooth (part 1) (#91673)
* Fix lingering timers in bluetooth (part 1)

* Use a local var
2023-04-20 18:07:38 +02:00