Add slots to bluetooth matcher objects (#109768)

pull/109811/head
J. Nick Koston 2024-02-06 08:40:03 -06:00 committed by GitHub
parent 1e5ab3ad47
commit cf188eabdf
No known key found for this signature in database
GPG Key ID: B5690EEEBB952194
1 changed files with 14 additions and 0 deletions

View File

@ -90,6 +90,8 @@ def seen_all_fields(
class IntegrationMatcher:
"""Integration matcher for the bluetooth integration."""
__slots__ = ("_integration_matchers", "_matched", "_matched_connectable", "_index")
def __init__(self, integration_matchers: list[BluetoothMatcher]) -> None:
"""Initialize the matcher."""
self._integration_matchers = integration_matchers
@ -159,6 +161,16 @@ class BluetoothMatcherIndexBase(Generic[_T]):
any bucket and we can quickly reject the service info as not matching.
"""
__slots__ = (
"local_name",
"service_uuid",
"service_data_uuid",
"manufacturer_id",
"service_uuid_set",
"service_data_uuid_set",
"manufacturer_id_set",
)
def __init__(self) -> None:
"""Initialize the matcher index."""
self.local_name: dict[str, list[_T]] = {}
@ -285,6 +297,8 @@ class BluetoothCallbackMatcherIndex(
Supports matching on addresses.
"""
__slots__ = ("address", "connectable")
def __init__(self) -> None:
"""Initialize the matcher index."""
super().__init__()