Small speed up to client callbacks (#678)
This commit is contained in:
parent
a0cf5d0e90
commit
f1a9f4b452
|
@ -0,0 +1,10 @@
|
|||
|
||||
cdef dict SUBSCRIBE_STATES_RESPONSE_TYPES
|
||||
|
||||
cdef bint TYPE_CHECKING
|
||||
|
||||
cdef object CameraImageResponse, CameraState
|
||||
|
||||
cdef object HomeassistantServiceCall
|
||||
|
||||
cdef object BluetoothLEAdvertisement
|
|
@ -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,),
|
||||
)
|
||||
|
||||
|
|
1
setup.py
1
setup.py
|
@ -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",
|
||||
|
|
Loading…
Reference in New Issue