coherence.upnp.devices.control_point (module) — Cohen3 0.8.0 documentation

# coherence.upnp.devices.control_point (module)

## Control Point

### `DeviceQuery`

A convenient class that allow us to create request queries to control point.

### `ControlPoint`

Takes care of managing the different devices detected by our instance of class `Coherence`.

### `XMLRPC`

A resource that implements XML-RPC.

Note

XML-RPC is a remote procedure call (RPC) protocol which uses XML to encode its calls and HTTP as a transport mechanism. “XML-RPC” also refers generically to the use of XML for remote procedure call, independently of the specific protocol.

See also

XML-RPC information extracted from: https://en.wikipedia.org/wiki/XML-RPC

class `DeviceQuery`(type, pattern, callback, timeout=0, oneshot=True)

  Bases: `eventdispatcher.eventdispatcher.EventDispatcher`

  Changed in version 0.9.0:

  - Introduced inheritance from EventDispatcher

  - Changed class variable `fired` to benefit from the EventDispatcher’s properties

  `fired`
  `fire`(device)
  `check`(device)

class `ControlPoint`(coherence, auto_client=None)

  Bases: `eventdispatcher.eventdispatcher.EventDispatcher`, `coherence.log.LogAble`

  Changed in version 0.9.0:

  - Introduced inheritance from EventDispatcher, emitted events changed:

    > - Coherence.UPnP.ControlPoint.{client.device_type}.detected => control_point_client_detected’
    > - Coherence.UPnP.ControlPoint.{client.device_type}.removed => control_point_client_removed

  - Changed class variable `queries` to benefit from the EventDispatcher’s properties

  Warning

  Be aware that some events are removed, with the new dispatcher we remove the detection for specific device type in flavour of a global detection.

  `logCategory` = 'controlpoint'
  `queries`
  `shutdown`()
  `auto_client_append`(device_type)
  `browse`(device)
  `process_queries`(device)
  `add_query`(query)
  static `check_louie`(receiver, signal, method='connect')

    Check if the connect or disconnect method’s arguments are valid in order to automatically convert to EventDispatcher’s bind method. The old valid signals are:

    > - Coherence.UPnP.ControlPoint.MediaServer.detected
    > - Coherence.UPnP.ControlPoint.MediaServer.removed
    > - Coherence.UPnP.ControlPoint.MediaRenderer.detected
    > - Coherence.UPnP.ControlPoint.MediaRenderer.removed
    > - Coherence.UPnP.ControlPoint.InternetGatewayDevice.detected
    > - Coherence.UPnP.ControlPoint.InternetGatewayDevice.removed

    New in version 0.9.0.

  `connect`(receiver, signal=None, sender=None, weak=True)

    Wrapper method around the deprecated method louie.connect. It will check if the passed signal is supported by executing the method `check_louie()`.

    Warning

    This will probably be removed at some point, if you use the connect method you should consider to migrate to the new event system EventDispatcher.

    Changed in version 0.9.0: Added EventDispatcher’s compatibility for some basic signals

  `disconnect`(receiver, signal=None, sender=None, weak=True)

    Wrapper method around the deprecated method louie.disconnect. It will check if the passed signal is supported by executing the method `check_louie()`.

    Warning

    This will probably be removed at some point, if you use the disconnect method you should migrate to the new event system EventDispatcher.

    Changed in version 0.9.0: Added EventDispatcher’s compatibility for some basic signals

  `get_devices`()
  `get_device_with_id`(id)
  `get_device_by_host`(host)
  `check_device`(device)
  `completed`(client, *args)
  `remove_client`(udn, client)
  `propagate`(event)
  `put_resource`(url, path)

class `XMLRPC`(control_point)

  Bases: `twisted.web.xmlrpc.XMLRPC`

  `xmlrpc_list_devices`()
  `xmlrpc_mute_device`(device_id)
  `xmlrpc_unmute_device`(device_id)
  `xmlrpc_set_volume`(device_id, volume)
  `xmlrpc_play`(device_id)
  `xmlrpc_pause`(device_id)
  `xmlrpc_stop`(device_id)
  `xmlrpc_next`(device_id)
  `xmlrpc_previous`(device_id)
  `xmlrpc_set_av_transport_uri`(device_id, uri)
  `xmlrpc_create_object`(device_id, container_id, arguments)
  `xmlrpc_import_resource`(device_id, source_uri, destination_uri)
  `xmlrpc_put_resource`(url, path)
  `xmlrpc_ping`()

`startXMLRPC`(control_point, port)