Commit Graph

63 Commits (d4e72c49faa6f7ac6d3b2c0d1fd4550041f4afe5)

Author SHA1 Message Date
Ville Skyttä e7b6037419
Remove unnnecessary pylint configs from components [e-l]* (#99004) 2023-08-25 09:46:34 +02:00
Marc Mueller e2d2ec8817
Use asyncio.timeout [b-e] (#98448) 2023-08-15 08:30:20 -05: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 24b9bde9e5
Fix duplicate and missing decorators in ESPHome Bluetooth client (#97027) 2023-07-22 13:10:41 +02:00
J. Nick Koston 2c4e4428e9
Decouple more of ESPHome Bluetooth support (#96502)
* Decouple more of ESPHome Bluetooth support

The goal is to be able to move more of this into an external library

* Decouple more of ESPHome Bluetooth support

The goal is to be able to move more of this into an external library

* Decouple more of ESPHome Bluetooth support

The goal is to be able to move more of this into an external library

* Decouple more of ESPHome Bluetooth support

The goal is to be able to move more of this into an external library

* Decouple more of ESPHome Bluetooth support

The goal is to be able to move more of this into an external library

* fix diag

* remove need for hass in the client

* refactor

* decouple more

* decouple more

* decouple more

* decouple more

* decouple more

* remove unreachable code

* remove unreachable code
2023-07-21 16:41:50 -04:00
J. Nick Koston 7814ce06f4
Fix ESPHome bluetooth client cancel behavior when device unexpectedly disconnects (#96918) 2023-07-21 13:44:13 -05:00
J. Nick Koston 6bd4ace3c3
Fix ESPHome bluetooth client cancellation when the operation is cancelled externally (#96804) 2023-07-18 03:39:26 -10:00
J. Nick Koston c44c7bba84
Simplify ESPHome bluetooth disconnected during operation wrapper (#96459) 2023-07-13 16:45:45 -10: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
Ville Skyttä f7938c940c
Upgrade ruff to 0.0.272 (#94290) 2023-06-08 21:53:43 +02:00
J. Nick Koston 88bfd94800
Add support for ESPHome raw bluetooth advertisements (#94138)
Co-authored-by: Jesse Hills <3060199+jesserockz@users.noreply.github.com>
2023-06-07 18:36:22 -05:00
J. Nick Koston 4420201fe6
Use bluetooth data tools for address conversion in esphome (#91443) 2023-04-16 11:55:08 -10:00
J. Nick Koston 6a5c05e7d2
Add support for clearing the on device GATT cache to esphome (#90318) 2023-03-27 09:34:28 +02:00
J. Nick Koston a7c796a2f7
Ensure esphome connected future is awaited when connecting is canceled (#90329) 2023-03-26 12:30:00 -10:00
J. Nick Koston 8c9966aa05
Ensure esphome subscribes to bluetooth connection free before accepting connect requests (#90319) 2023-03-26 22:06:14 +02:00
J. Nick Koston c3043fb0ee
Bump bluetooth deps for bleak 0.20 (#89925)
Co-authored-by: K <z@kwi.li>
2023-03-20 12:06:15 +01:00
epenet ff2a88b426
Bump ruff to 0.0.254 (#89273) 2023-03-07 13:25:31 +01:00
J. Nick Koston ee89922c1b
Add support for bluetooth pairing in esphome (#88603)
Co-authored-by: Jesse Hills <3060199+jesserockz@users.noreply.github.com>
2023-03-06 14:24:35 -10:00
epenet eebcf70b41
Re-enable Ruff D411 (#89035) 2023-03-02 13:01:05 -05:00
Franck Nijhof d3ed8de232
Update Ruff to v0.0.247 (#88210)
* Update Ruff to v0.0.247

* Fix new found violations
2023-02-15 16:46:03 -05:00
J. Nick Koston 978aafdd09
Update esphome bluetooth client for python 3.11 (#86480) 2023-01-23 21:36:19 +01:00
Aarni Koskela c0d9dcdb3f
Fix docstring in esphome.bluetooth.client (#86226) 2023-01-19 15:21:32 +01:00
Franck Nijhof 382e1ac679
Code styling tweaks to the ESPHome integration (#86146) 2023-01-18 11:10:16 +01:00
Franck Nijhof b0cee0bc46
String formatting and max line length - Part 1 (#84390)
Co-authored-by: Erik Montnemery <erik@montnemery.com>
2022-12-22 10:12:50 +01:00
J. Nick Koston 5a970e0a2b
Adjust additional esphome bluetooth debug messages for unique id change (#83955) 2022-12-13 12:57:29 -10:00
J. Nick Koston 95641fa780
Revert "Move esphome gatt services cache to be per device" #81265 (#83793) 2022-12-11 17:50:18 -10:00
J. Nick Koston 7178cacdc2
Adjust esphome bluetooth client logging for unique id change (#83742) 2022-12-10 17:45:59 -10:00
Paulus Schoutsen d3df4dd3c1
ESPHome: Use MAC as unique ID (#83741)
* ESPHome: Use MAC as unique ID

* Normalize incoming zeroconf/dhcp macs

* Update comment

* Test ESPHome without mac in zeroconf

* Use format_mac

* Remove unique ID index from DomainData
2022-12-10 22:26:42 -05:00
J. Nick Koston 09f9bb05dc
Add bluetooth diagnostics to shelly (#83438)
* Add bluetooth diagnostics to shelly

* Add tests

Co-authored-by: Shay Levy <levyshay1@gmail.com>
2022-12-09 10:55:10 -05:00
J. Nick Koston 3044e78d43
Avoid regex overhead in processing esphome bluetooth advertisements (#83246) 2022-12-04 21:09:45 -05:00
J. Nick Koston c617e7da31
Raise an exception when an esp proxy gets empty services during connection so callers know to retry (#83211) 2022-12-04 09:05:46 -10:00
J. Nick Koston 955d4abf13
Fix missing services with esp32 proxies (#83192) 2022-12-03 13:50:59 -05:00
J. Nick Koston de1e97a81f
Fix esphome ble client leaking notify on disconnect (#83106)
* Fix esphome ble client leaking notify on disconnect

needs: https://github.com/esphome/aioesphomeapi/pull/329

* leak

* more cleanup

* more cleanup

* bump
2022-12-02 19:45:49 -05:00
Marc Mueller 490aec0b11
Update pylint to 2.15.7 (#82977) 2022-11-30 12:20:18 +01:00
J. Nick Koston 46b18367f7
Send back BLE address type when connecting via esphome proxies (#82890) 2022-11-28 18:54:53 -10:00
J. Nick Koston fb98128b9f
Add support for esphome ble client connections v3 (#82815) 2022-11-28 16:56:18 -10:00
J. Nick Koston d451a74c2d
Add a destruction check to the ESPHome bluetooth client (#82760) 2022-11-27 21:17:35 -05:00
J. Nick Koston f0ae1cc6ce
Add bluetooth diagnostics to esphome (#82761) 2022-11-27 14:59:37 -05:00
J. Nick Koston 18dd605a74
Fix un-retrieved future in esphome ble client when library raises (#82537) 2022-11-24 10:38:53 -10:00
J. Nick Koston 188cdd1bac
Ensure esphome client tasks await cancelation (#82547) 2022-11-23 10:07:05 +01:00
J. Nick Koston a7caa038be
Accept advertisements from alternate scanners when a scanner stops scanning (#82448) 2022-11-21 21:23:07 -05:00
Marc Mueller 8f33ad38cf
Update pylint to 2.15.6 (#82440)
* Update pylint to 2.15.6

* Use single pylint disable

* Use implicit dict constructor
2022-11-21 08:58:45 +01:00
J. Nick Koston f584efa0c2
Move bluetooth remote scanner implementation into a base class (#82012) 2022-11-13 14:18:36 -06:00
J. Nick Koston 6517e3e21e
Fix esphome bleak client seeing disconnects too late (#81932)
* Fix esphome bleak client seeing disconnects too late

Because allbacks are delivered asynchronously its possible
that we find out during the operation before the callback
is delivered telling us about the disconnected.

We now watch for error code -1 which indicates the connection
dropped out from under us

* debug logging

* cleanup comment

* Fix comment grammar

Co-authored-by: Martin Hjelmare <marhje52@gmail.com>
2022-11-11 09:09:28 +01:00
J. Nick Koston 6495c65d10
Align esphome ble client notify behavior to match BlueZ (#81463) 2022-11-05 15:28:47 -05:00
J. Nick Koston 972b36b469
Adjust time to remove stale connectable devices from the esphome ble to closer match bluez (#81356) 2022-11-01 13:07:42 -04:00
J. Nick Koston d87ca0b099
Improve esphome bluetooth error reporting (#81326) 2022-10-31 21:21:11 -04:00
J. Nick Koston 1589c06203
Significantly reduce clock_gettime syscalls on platforms with broken vdso (#81257) 2022-10-31 09:35:08 -04:00
J. Nick Koston 8db7afb2e0
Include esphome device name in BLE logs (#81284)
* Include esphome device name in BLE logs

This makes it easier to debug what is going on when there
are multiple esphome proxies

* revert unintended change
2022-10-31 00:31:37 -05:00