base: rename the hotplugged argument

This one is a bit confusing, because most of the time it's not a hotplug
event, it's just the RSSI property updating.
pull/147/head
Peter Hutterer 2019-07-15 21:24:11 +10:00
parent 5b73c8ea2d
commit deb2c3ad2f
1 changed files with 4 additions and 4 deletions

View File

@ -355,7 +355,7 @@ class Tuhi(GObject.Object):
# restart discovery if some users are already in the listening mode # restart discovery if some users are already in the listening mode
self._on_listening_updated(None, None) self._on_listening_updated(None, None)
def _add_device(self, manager, bluez_device, hotplugged=False): def _add_device(self, manager, bluez_device, from_live_update=False):
''' '''
Process a new BlueZ device that may be one of our devices. Process a new BlueZ device that may be one of our devices.
@ -363,7 +363,7 @@ class Tuhi(GObject.Object):
BlueZ devices and for every BlueZ device property change. Including BlueZ devices and for every BlueZ device property change. Including
RSSI which will give you a value every second or so. RSSI which will give you a value every second or so.
.. :param hotplugged: True if this function was called from a BlueZ .. :param from_live_update: True if this function was called from a BlueZ
device property update. False when called during the initial setup device property update. False when called during the initial setup
stage. stage.
''' '''
@ -380,10 +380,10 @@ class Tuhi(GObject.Object):
if uuid is None and bluez_device.vendor_id not in WACOM_COMPANY_IDS: if uuid is None and bluez_device.vendor_id not in WACOM_COMPANY_IDS:
return return
# if the device has been 'hotplugged' in the bluez stack, # if we got here from a currently live BlueZ device,
# ManufacturerData is reliable. Else, consider the device not in # ManufacturerData is reliable. Else, consider the device not in
# register mode # register mode
if hotplugged and Tuhi._device_in_register_mode(bluez_device): if from_live_update and Tuhi._device_in_register_mode(bluez_device):
mode = DeviceMode.REGISTER mode = DeviceMode.REGISTER
else: else:
mode = DeviceMode.LISTEN mode = DeviceMode.LISTEN