diff --git a/README.rst b/README.rst index d39b8f6..b4eeedf 100644 --- a/README.rst +++ b/README.rst @@ -126,6 +126,8 @@ Changelog --------- Beacontools follows the `semantic versioning `__ scheme. +* 2.0.1 + * Removed (unused) rfu field from the Eddystone UID packet, fixes #39 * 2.0.0 * Dropped support for Python 2.7 and 3.4 * Added support for COVID-19 Exposure Notifications diff --git a/beacontools/device_filters.py b/beacontools/device_filters.py index c67fb91..5b9d7f6 100644 --- a/beacontools/device_filters.py +++ b/beacontools/device_filters.py @@ -35,7 +35,7 @@ class CJMonitorFilter(DeviceFilter): def __init__(self, company_id=CJ_MANUFACTURER_ID, beacon_type=CJ_TEMPHUM_TYPE): """Initialize filter.""" - super(CJMonitorFilter, self).__init__() + super().__init__() if company_id is None and beacon_type is None: raise ValueError("CJMonitorFilter needs at least one argument set") if company_id is not None: @@ -48,7 +48,7 @@ class IBeaconFilter(DeviceFilter): def __init__(self, uuid=None, major=None, minor=None): """Initialize filter.""" - super(IBeaconFilter, self).__init__() + super().__init__() if uuid is None and major is None and minor is None: raise ValueError("IBeaconFilter needs at least one argument set") if uuid is not None: @@ -64,7 +64,7 @@ class EddystoneFilter(DeviceFilter): def __init__(self, namespace=None, instance=None): """Initialize filter.""" - super(EddystoneFilter, self).__init__() + super().__init__() if namespace is None and instance is None: raise ValueError("EddystoneFilter needs at least one argument set") if namespace is not None: @@ -78,7 +78,7 @@ class EstimoteFilter(DeviceFilter): def __init__(self, identifier=None, protocol_version=None): """Initialize filter.""" - super(EstimoteFilter, self).__init__() + super().__init__() if identifier is None and protocol_version is None: raise ValueError("EstimoteFilter needs at least one argument set") if identifier is not None: @@ -92,7 +92,7 @@ class ExposureNotificationFilter(DeviceFilter): def __init__(self, identifier): """Initialize filter.""" - super(ExposureNotificationFilter, self).__init__() + super().__init__() if identifier is None: raise ValueError("ExposureNotificationFilter needs identifier to be set") self.properties['identifier'] = identifier @@ -103,11 +103,11 @@ class BtAddrFilter(DeviceFilter): def __init__(self, bt_addr): """Initialize filter.""" - super(BtAddrFilter, self).__init__() + super().__init__() try: bt_addr = bt_addr.lower() - except AttributeError: - raise ValueError("bt_addr({}) wasn't a string".format(bt_addr)) + except AttributeError as exc: + raise ValueError("bt_addr({}) wasn't a string".format(bt_addr)) from exc if not is_valid_mac(bt_addr): raise ValueError("Invalid bluetooth MAC address given," " format should match aa:bb:cc:dd:ee:ff") diff --git a/beacontools/structs/eddystone.py b/beacontools/structs/eddystone.py index 0b9944c..bca2078 100644 --- a/beacontools/structs/eddystone.py +++ b/beacontools/structs/eddystone.py @@ -10,7 +10,9 @@ "tx_power" / Int8sl, "namespace" / Array(10, Byte), "instance" / Array(6, Byte), - "rfu" / Array(2, Byte) + # commented out because it is not used anyway and there seem to be beacons which + # don't send it at all (see https://github.com/citruz/beacontools/issues/39) + # "rfu" / Array(2, Byte) ) EddystoneURLFrame = Struct( diff --git a/setup.py b/setup.py index 08f0145..b453bdc 100644 --- a/setup.py +++ b/setup.py @@ -13,7 +13,7 @@ setup( name='beacontools', - version='2.0.0', + version='2.0.1', description='A Python library for working with various types of Bluetooth LE Beacons.', long_description=long_description,