platypush/plugins/bluetooth/__init__.py
def lookup_address(self, name: str, timeout: int = 10) -> BluetoothLookupNameResponse:
        """
        Look up the address of a nearby bluetooth device given the name

        :param name: Device name
        :param timeout: Lookup timeout (default: 10 seconds)
        """

        self.logger.info('Looking up address for device {}'.format(name))
        discoverer = self._DeviceDiscoverer(name)
        discoverer.find_devices(lookup_names=True, duration=timeout)
        readfiles = [discoverer]

        while True:
            rfds = select.select(readfiles, [], [])[0]
            if discoverer in rfds:
                discoverer.process_event()

            if discoverer.done:
                break

        dev = discoverer.device
        if not dev:
            raise RuntimeError('No such device: {}'.format(name))

        addr = dev.get('addr')
        self._devices_by_addr[addr] = dev
        self._devices_by_name[name] = dev
        return BluetoothLookupNameResponse(addr=addr, name=name)

        Look up the address of a nearby bluetooth device given the name

        :param name: Device name
        :param timeout: Lookup timeout (default: 10 seconds)
        
Look up the address of a nearby bluetooth device given the name
Look up the address of a nearby bluetooth device given the name
def lookup_address(self, name: str, timeout: int = 10) -> BluetoothLookupNameResponse:
        self.logger.info('Looking up address for device {}'.format(name))
        discoverer = self._DeviceDiscoverer(name)
        discoverer.find_devices(lookup_names=True, duration=timeout)
        readfiles = [discoverer]
        while True:
            rfds = select.select(readfiles, [], [])[0]
            if discoverer in rfds:
                discoverer.process_event()
            if discoverer.done:
                break
        dev = discoverer.device
        if not dev:
            raise RuntimeError('No such device: {}'.format(name))
        addr = dev.get('addr')
        self._devices_by_addr[addr] = dev
        self._devices_by_name[name] = dev
        return BluetoothLookupNameResponse(addr=addr, name=name)
def lookup_address ( self , name : str , timeout : int = 10 ) -> BluetoothLookupNameResponse : self . logger . info ( 'Looking up address for device {}' . format ( name ) ) discoverer = self . _DeviceDiscoverer ( name ) discoverer . find_devices ( lookup_names = True , duration = timeout ) readfiles = [ discoverer ] while True : rfds = select . select ( readfiles , [ ] , [ ] ) [ 0 ] if discoverer in rfds : discoverer . process_event ( ) if discoverer . done : break dev = discoverer . device if not dev : raise RuntimeError ( 'No such device: {}' . format ( name ) ) addr = dev . get ( 'addr' ) self . _devices_by_addr [ addr ] = dev self . _devices_by_name [ name ] = dev return BluetoothLookupNameResponse ( addr = addr , name = name )
Look up the address of a nearby bluetooth device given the name
Look up the address of a nearby bluetooth device given the name
"""
        Look up the address of a nearby bluetooth device given the name

        :param name: Device name
        :param timeout: Lookup timeout (default: 10 seconds)
        """
self
name
str
None
timeout
int
Lookup timeout (default: 10 seconds)
Lookup timeout ( default : 10 seconds )