mirror of
https://github.com/home-assistant/core.git
synced 2025-07-19 11:17:21 +00:00
Drop RSSI update workaround from bluetooth on linux (#75467)
It turns out we do not need these are we can check the discovered device list to see if bluez is still seeing the device
This commit is contained in:
parent
1626c53c13
commit
0f81d1d14a
@ -6,7 +6,6 @@ from dataclasses import dataclass
|
|||||||
from enum import Enum
|
from enum import Enum
|
||||||
import fnmatch
|
import fnmatch
|
||||||
import logging
|
import logging
|
||||||
import platform
|
|
||||||
from typing import Final, TypedDict, Union
|
from typing import Final, TypedDict, Union
|
||||||
|
|
||||||
from bleak import BleakError
|
from bleak import BleakError
|
||||||
@ -217,20 +216,6 @@ def _ble_device_matches(
|
|||||||
return True
|
return True
|
||||||
|
|
||||||
|
|
||||||
@hass_callback
|
|
||||||
def async_enable_rssi_updates() -> None:
|
|
||||||
"""Bleak filters out RSSI updates by default on linux only."""
|
|
||||||
# We want RSSI updates
|
|
||||||
if platform.system() == "Linux":
|
|
||||||
from bleak.backends.bluezdbus import ( # pylint: disable=import-outside-toplevel
|
|
||||||
scanner,
|
|
||||||
)
|
|
||||||
|
|
||||||
scanner._ADVERTISING_DATA_PROPERTIES.add( # pylint: disable=protected-access
|
|
||||||
"RSSI"
|
|
||||||
)
|
|
||||||
|
|
||||||
|
|
||||||
class BluetoothManager:
|
class BluetoothManager:
|
||||||
"""Manage Bluetooth."""
|
"""Manage Bluetooth."""
|
||||||
|
|
||||||
@ -265,7 +250,6 @@ class BluetoothManager:
|
|||||||
ex,
|
ex,
|
||||||
)
|
)
|
||||||
return
|
return
|
||||||
async_enable_rssi_updates()
|
|
||||||
install_multiple_bleak_catcher(self.scanner)
|
install_multiple_bleak_catcher(self.scanner)
|
||||||
# We have to start it right away as some integrations might
|
# We have to start it right away as some integrations might
|
||||||
# need it straight away.
|
# need it straight away.
|
||||||
|
Loading…
x
Reference in New Issue
Block a user