From 33d1d3d8c4e288fc6ae2df9fea74a70263676a40 Mon Sep 17 00:00:00 2001 From: "J. Nick Koston" Date: Fri, 24 Nov 2023 12:04:12 -0600 Subject: [PATCH] Speed up noise frame helper (#693) --- aioesphomeapi/_frame_helper/noise.pxd | 11 ++++++----- 1 file changed, 6 insertions(+), 5 deletions(-) diff --git a/aioesphomeapi/_frame_helper/noise.pxd b/aioesphomeapi/_frame_helper/noise.pxd index 41923e0..70366e6 100644 --- a/aioesphomeapi/_frame_helper/noise.pxd +++ b/aioesphomeapi/_frame_helper/noise.pxd @@ -24,15 +24,16 @@ cdef class APINoiseFrameHelper(APIFrameHelper): @cython.locals( header=bytes, - preamble=cython.uint, - msg_size_high=cython.uint, - msg_size_low=cython.uint, + preamble="unsigned char", + msg_size_high="unsigned char", + msg_size_low="unsigned char", ) cpdef data_received(self, object data) @cython.locals( - type_high=cython.uint, - type_low=cython.uint + msg=bytes, + type_high="unsigned char", + type_low="unsigned char" ) cdef _handle_frame(self, bytes frame)