Classes | |
| class | _BluetoothCallbackMatcherWithCallback |
| class | BluetoothCallbackMatcher |
| class | BluetoothCallbackMatcherIndex |
| class | BluetoothCallbackMatcherOptional |
| class | BluetoothCallbackMatcherWithCallback |
| class | BluetoothMatcherIndex |
| class | BluetoothMatcherIndexBase |
| class | IntegrationMatcher |
| class | IntegrationMatchHistory |
Functions | |
| None | __init__ (self) |
| re.Pattern | _compile_fnmatch (str pattern) |
| str | _local_name_to_index_key (str local_name) |
| bool | _memorized_fnmatch (str name, str pattern) |
| bool | add (self, _T matcher) |
| bool | ble_device_matches (BluetoothMatcherOptional matcher, BluetoothServiceInfoBleak service_info) |
| None | build (self) |
| list[_T] | match (self, BluetoothServiceInfoBleak service_info) |
| bool | remove (self, _T matcher) |
| bool | seen_all_fields (IntegrationMatchHistory previous_match, AdvertisementData advertisement_data) |
Variables | |
| tuple | __slots__ |
| Final | |
| int | LOCAL_NAME_MIN_MATCH_LENGTH = 3 |
| manufacturer_id_set | |
| service_data_uuid_set | |
| service_uuid_set | |
The bluetooth integration matchers.
| None homeassistant.components.bluetooth.match.__init__ | ( | self | ) |
|
private |
|
private |
|
private |
Memorized version of fnmatch that has a larger lru_cache. The default version of fnmatch only has a lru_cache of 256 entries. With many devices we quickly reach that limit and end up compiling the same pattern over and over again. Bluetooth has its own memorized fnmatch with its own lru_cache since the data is going to be relatively the same since the devices will not change frequently.
| bool homeassistant.components.bluetooth.match.add | ( | self, | |
| _T | matcher | ||
| ) |
| bool homeassistant.components.bluetooth.match.ble_device_matches | ( | BluetoothMatcherOptional | matcher, |
| BluetoothServiceInfoBleak | service_info | ||
| ) |
| None homeassistant.components.bluetooth.match.build | ( | self | ) |
| list[_T] homeassistant.components.bluetooth.match.match | ( | self, | |
| BluetoothServiceInfoBleak | service_info | ||
| ) |
| bool homeassistant.components.bluetooth.match.remove | ( | self, | |
| _T | matcher | ||
| ) |
| bool homeassistant.components.bluetooth.match.seen_all_fields | ( | IntegrationMatchHistory | previous_match, |
| AdvertisementData | advertisement_data | ||
| ) |
|
private |
Bluetooth matcher base for the bluetooth integration. The indexer puts each matcher in the bucket that it is most likely to match. This allows us to only check the service infos against each bucket to see if we should match against the data. This is optimized for cases when no service infos will be matched in any bucket and we can quickly reject the service info as not matching.
| int homeassistant.components.bluetooth.match.LOCAL_NAME_MIN_MATCH_LENGTH = 3 |
| homeassistant.components.bluetooth.match.manufacturer_id_set |
| homeassistant.components.bluetooth.match.service_data_uuid_set |