Small speed up to client callbacks (#678)

This commit is contained in:
J. Nick Koston 2023-11-23 18:46:52 +01:00 committed by GitHub
parent a0cf5d0e90
commit f1a9f4b452
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
3 changed files with 14 additions and 2 deletions

View File

@ -0,0 +1,10 @@
cdef dict SUBSCRIBE_STATES_RESPONSE_TYPES
cdef bint TYPE_CHECKING
cdef object CameraImageResponse, CameraState
cdef object HomeassistantServiceCall
cdef object BluetoothLEAdvertisement

View File

@ -7,7 +7,8 @@ from aioesphomeapi.api_pb2 import (
BluetoothLERawAdvertisementsResponse,
)
from aioesphomeapi.client import APIClient
from aioesphomeapi.client_callbacks import on_ble_raw_advertisement_response
# cythonize -X language_level=3 -a -i aioesphomeapi/client_callbacks.py
# cythonize -X language_level=3 -a -i aioesphomeapi/connection.py
@ -47,7 +48,7 @@ def on_advertisements(msgs: list[BluetoothLERawAdvertisement]):
connection.add_message_callback(
partial(client._on_ble_raw_advertisement_response, on_advertisements),
partial(on_ble_raw_advertisement_response, on_advertisements),
(BluetoothLERawAdvertisementsResponse,),
)

View File

@ -30,6 +30,7 @@ GITHUB_URL = "https://github.com/{}".format(GITHUB_PATH)
DOWNLOAD_URL = "{}/archive/{}.zip".format(GITHUB_URL, VERSION)
MODULES_TO_CYTHONIZE = [
"aioesphomeapi/client_callbacks.py",
"aioesphomeapi/connection.py",
"aioesphomeapi/_frame_helper/plain_text.py",
"aioesphomeapi/_frame_helper/noise.py",