From cf188eabdf1a67ed1c08a3d82f041d3a0bd90ed3 Mon Sep 17 00:00:00 2001 From: "J. Nick Koston" Date: Tue, 6 Feb 2024 08:40:03 -0600 Subject: [PATCH] Add slots to bluetooth matcher objects (#109768) --- homeassistant/components/bluetooth/match.py | 14 ++++++++++++++ 1 file changed, 14 insertions(+) diff --git a/homeassistant/components/bluetooth/match.py b/homeassistant/components/bluetooth/match.py index 453ab996abc..2fd650d9580 100644 --- a/homeassistant/components/bluetooth/match.py +++ b/homeassistant/components/bluetooth/match.py @@ -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__()