Существует вариант, который вы можете использовать: https://www.w3schools.com/jquery/prop_jquery_fx_off.asp
Попробуйте использовать модуль struct :
import struct
# read 2 bytes from hardware as a string
s = hardware.readbytes(2)
# h means signed short
# < means "little-endian, standard size (16 bit)"
# > means "big-endian, standard size (16 bit)"
value = struct.unpack("<h", s) # hardware returns little-endian
value = struct.unpack(">h", s) # hardware returns big-endian