Only convert 16-bit UUIDs to bytes. Reuse the 128-bit value.
This commit is contained in:
parent
a741c93797
commit
9b5b53392f
1 changed files with 3 additions and 1 deletions
|
|
@ -50,7 +50,9 @@ class UUID:
|
|||
return str(self.bleio_uuid)
|
||||
|
||||
def __bytes__(self):
|
||||
b = bytearray(self.bleio_uuid.size // 8)
|
||||
if self.bleio_uuid.size == 128:
|
||||
return self.bleio_uuid.uuid128
|
||||
b = bytearray(2)
|
||||
self.bleio_uuid.pack_into(b)
|
||||
return bytes(b)
|
||||
|
||||
|
|
|
|||
Loading…
Reference in a new issue