coherence.upnp.core.device (module)¶
Devices¶
This module contains two classes describing UPnP devices.
RootDevice
¶
A device representing a root device.
-
class
Device
(parent=None, udn=None)[source]¶ Bases:
eventdispatcher.eventdispatcher.EventDispatcher
,coherence.log.LogAble
Represents a UPnP’s device, but this is not a root device, it’s the base class used for any device. See
RootDevice
if you want a root device.-
Changed in version 0.9.0:
Migrated from louie/dispatcher to EventDispatcher
The emitted events changed:
Coherence.UPnP.Device.detection_completed => device_detection_completed
Coherence.UPnP.Device.remove_client => device_remove_client
New events: device_service_notified, device_got_client
Changes some class variables to benefit from the EventDispatcher’s properties:
-
logCategory
= 'device'¶
-
client
¶ Defined by
ControlPoint
. It should be one of:Initialized instance of a class
MediaServerClient
Initialized instance of a class
MediaRendererClient
Initialized instance of a class
InternetGatewayDeviceClient
Whenever a client is set an event will be sent notifying it by
on_client()
.
-
icons
¶ A list of the device icons.
-
devices
¶ A list of the device devices.
-
services
¶ A list of the device services.
-
detection_completed
¶ To know whenever the device detection has completed. Defaults to False and it will be set automatically to True by the class method
receiver()
.
-
add_service
(service)[source]¶ Add a service to the device. Also we check if service already notified, and trigger the callback if needed. We also connect the device to service in case the service still not completed his detection in order that the device knows when the service has completed his detection.
-
on_client
(*args)[source]¶ Automatically triggered whenever a client is set or changed. Emmit an event notifying that the client has changed.
New in version 0.9.0.
-
class
RootDevice
(infos)[source]¶ Bases:
coherence.upnp.core.device.Device
Description for a root device.
-
Changed in version 0.9.0:
Migrated from louie/dispatcher to EventDispatcher
The emitted events changed:
Coherence.UPnP.RootDevice.detection_completed => root_device_detection_completed
Coherence.UPnP.RootDevice.removed => root_device_removed
-
root_detection_completed
¶ To know whenever the root device detection has completed. Defaults to False and it will be set automatically to True by the class method
device_detect()
.
-
device_detect
(*args, **kwargs)[source]¶ This method is automatically triggered whenever the property of the base class
Device.detection_completed
is set to True. Here we perform some more operations, before theRootDevice
emits an event notifying that the root device detection has completed.