base: simplify check for in register mode

With a "or []" we can force this to be at least a 0-length list, obsoleting
the None check.
This commit is contained in:
Peter Hutterer 2019-07-17 10:03:57 +10:00
parent e1a3675439
commit 37b9b2eefa
1 changed files with 1 additions and 2 deletions

View File

@ -336,8 +336,7 @@ class Tuhi(GObject.Object):
# When the device is in register mode (blue light blinking), the # When the device is in register mode (blue light blinking), the
# manufacturer is merely 4 bytes. This will reset to 7 bytes even # manufacturer is merely 4 bytes. This will reset to 7 bytes even
# when the device simply times out and does not register fully. # when the device simply times out and does not register fully.
manufacturer_data = bluez_device.manufacturer_data return len(bluez_device.manufacturer_data or []) == 4
return manufacturer_data is not None and len(manufacturer_data) == 4
def _on_bluez_discovery_started(self, manager): def _on_bluez_discovery_started(self, manager):
# Something else may turn discovery mode on, we don't care about # Something else may turn discovery mode on, we don't care about