From 99a0eb21c10c02de76fb34cb0367384931d5210a Mon Sep 17 00:00:00 2001 From: Abel Lucas Date: Tue, 29 Nov 2022 16:32:12 +0000 Subject: [PATCH] address: fix deprecated use of combined `@classmethod` and `@property` --- bumble/hci.py | 14 ++++---------- 1 file changed, 4 insertions(+), 10 deletions(-) diff --git a/bumble/hci.py b/bumble/hci.py index be5973b7..4805a6bd 100644 --- a/bumble/hci.py +++ b/bumble/hci.py @@ -1652,16 +1652,6 @@ class Address: ADDRESS_TYPE_SPEC = {'size': 1, 'mapper': lambda x: Address.address_type_name(x)} - @classmethod - @property - def ANY(cls): - return cls(b"\xff\xff\xff\xff\xff\xff", cls.PUBLIC_DEVICE_ADDRESS) - - @classmethod - @property - def NIL(cls): - return cls(b"\x00\x00\x00\x00\x00\x00", cls.PUBLIC_DEVICE_ADDRESS) - @staticmethod def address_type_name(address_type): return name_or_number(Address.ADDRESS_TYPE_NAMES, address_type) @@ -1759,6 +1749,10 @@ class Address: return str + '/P' +# Predefined address values +Address.NIL = Address(b"\xff\xff\xff\xff\xff\xff", Address.PUBLIC_DEVICE_ADDRESS) +Address.ANY = Address(b"\x00\x00\x00\x00\x00\x00", Address.PUBLIC_DEVICE_ADDRESS) + # ----------------------------------------------------------------------------- class OwnAddressType: PUBLIC = 0