Discovering Devices

To find flux devices in the network, fluxclient.upnp.Discover class provide interface to discover and collect informations continuously.

Basic usage example:

from fluxclient.upnp import UpnpDiscover

def my_callback(discover, device, **kw):
    print("Device '%s' found at %s" % (, device.ipaddr))

    # We find only one printer in this example

d = UpnpDiscover()

In the example, my_callback will be called one a device is found or recive a device status update. A callback contains two positional arguments, first is UpnpDiscover instance and second is fluxclient.upnp.device.Device instance which it found or been updated.

class, device_ipaddr=None, mcst_ipaddr='', mcst_port=1901)

The uuid and device_ipaddr param can limit UpnpDiscover to find device with specified uuid or IP address. These params usually be used when you want recive specified status continuously.

  • uuid (uuid.UUID) – Discover specified uuid of device only
  • device_ipaddr (string) – Discover device from specified IP address only.

There is a fast way to get a specific device object directlly

fluxclient.upnp.discover_device(uuid, lookup_callback=None, timeout=inf)

Discover and return device

  • uuid (uuid) – Device UUID
  • lookup_callback (callable) – A callable object will be invoke during discover.
Return type: