UPnP

Python implementation

class hat.drivers.upnp.DeviceInfo(addr, location, server, service)

Bases: tuple

Create new instance of DeviceInfo(addr, location, server, service)

addr

udp.Address

location

str

server

str

service

str

class hat.drivers.upnp.Icon(mimetype, width, height, depth, url)

Bases: tuple

Create new instance of Icon(mimetype, width, height, depth, url)

depth

int

height

int

mimetype

str

url

str

width

int

class hat.drivers.upnp.DeviceDescription(url, dev_type, dev_name, manufacturer, manufacturer_url, model_desc, model_name, model_number, model_url, serial_number, unique_dev_name, icons)

Bases: tuple

Create new instance of DeviceDescription(url, dev_type, dev_name, manufacturer, manufacturer_url, model_desc, model_name, model_number, model_url, serial_number, unique_dev_name, icons)

dev_name

str

dev_type

str

icons

List[Icon]

manufacturer

str

manufacturer_url

Optional[str]

model_desc

Optional[str]

model_name

str

model_number

Optional[str]

model_url

Optional[str]

serial_number

Optional[str]

unique_dev_name

str

url

Optional[str]

async hat.drivers.upnp.discover(device_info_cb, multicast_addr=Address(host='239.255.255.250', port=1900), local_name='hat')
Parameters
  • device_info_cb (Callable[[hat.drivers.upnp.DeviceInfo], None]) –

  • multicast_addr (hat.drivers.udp.Address) –

  • local_name (str) –

Return type

hat.drivers.upnp.DiscoveryServer

async hat.drivers.upnp.get_description(location)
Parameters

location (str) –

Return type

hat.drivers.upnp.DeviceDescription

class hat.drivers.upnp.DiscoveryServer

Bases: object

property closed
async async_close()