Package brisa :: Package upnp :: Package device :: Module device :: Class Device
[hide private]
[frames] | no frames]

Class Device

source code

            object --+    
base_device.BaseDevice --+

Class that represents a device.

When used with default settings, usage should be minimized to instantiation, start() and stop().

The special setting is a create_webserver keyword that can be passed during construction. If False, it disables the automatic creation of the internal webserver for serving device files, so, the user should create his own webserver and set Device.webserver to it.

Instance Methods [hide private]
__init__(self, *args, **kwargs)
Constructor for the Device class.
source code
add_service(self, service)
Adds a service to the device.
source code
_create_webserver(self, force_listen_url='') source code
_generate_xml(self) source code
_publish(self) source code
Starts the device.
source code
Stops the device.
source code
is_running(self) source code
destroy(self) source code
_cleanup(self) source code

Inherited from base_device.BaseDevice: add_device, del_device, del_service, del_service_by_id, get_service_by_type, is_root_device

Inherited from object: __delattr__, __format__, __getattribute__, __hash__, __new__, __reduce__, __reduce_ex__, __repr__, __setattr__, __sizeof__, __str__, __subclasshook__

Properties [hide private]

Inherited from object: __class__

Method Details [hide private]

__init__(self, *args, **kwargs)

source code 

Constructor for the Device class.

  • device_type (string) - device type as described on the device reference
  • friendly_name (string) - a friendly name

    Optional parameters follow below:

  • udn (string) - uuid for the device. If not specified will be automatically generated.
  • parent (Device) - parent device
  • manufacturer (string) - manufacturer
  • manufacturer_url (string) - manufacturer url
  • model_description (string) - model description
  • model_name (string) - model name
  • model_number (string) - model number
  • model_url (string) - model url
  • serial_number (string) - serial number
  • upc (string) - upc
  • presentation_url (string) - presentation url
  • create_webserver (bool) - see class description for more information. Default value is True and you should normally don't pass anything
  • force_listen_url (bool) - forces the webserver to listen on a specific address. If it's not possible to listen on that address, another random one will be generated and used automatically.
Overrides: object.__init__

add_service(self, service)

source code 

Adds a service to the device.

Overrides: base_device.BaseDevice.add_service