You can not select more than 25 topics Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.

144 lines
4.8 KiB

4 years ago
  1. Metadata-Version: 2.1
  2. Name: async-upnp-client
  3. Version: 0.13.4
  4. Summary: Async UPnP Client
  5. Home-page: https://github.com/StevenLooman/async_upnp_client
  6. Author: Steven Looman
  7. Author-email: steven.looman@gmail.com
  8. License: http://www.apache.org/licenses/LICENSE-2.0
  9. Platform: UNKNOWN
  10. Classifier: Development Status :: 5 - Production/Stable
  11. Classifier: Intended Audience :: Developers
  12. Classifier: License :: OSI Approved :: Apache Software License
  13. Classifier: Programming Language :: Python :: 3.5
  14. Classifier: Programming Language :: Python :: 3.6
  15. Classifier: Programming Language :: Python :: 3.7
  16. Requires-Dist: voluptuous (>=0.11.1)
  17. Requires-Dist: aiohttp (>=3.3.2)
  18. Requires-Dist: async-timeout (>=3.0.0)
  19. Requires-Dist: python-didl-lite (==1.2.0)
  20. Async UPnP Client
  21. =================
  22. Asyncio UPnP Client library for Python/asyncio.
  23. Written initially for use in `Home Assistant <https://github.com/home-assistant/home-assistant>`_ to drive `DLNA DMR`-capable devices, but useful for other projects as well.
  24. Status
  25. ------
  26. .. image:: https://img.shields.io/travis/StevenLooman/async_upnp_client.svg
  27. :target: https://travis-ci.org/StevenLooman/async_upnp_client/branches
  28. .. image:: https://img.shields.io/pypi/v/async_upnp_client.svg
  29. :target: https://pypi.python.org/pypi/async_upnp_client
  30. .. image:: https://img.shields.io/pypi/format/async_upnp_client.svg
  31. :target: https://pypi.python.org/pypi/async_upnp_client
  32. .. image:: https://img.shields.io/pypi/pyversions/async_upnp_client.svg
  33. :target: https://pypi.python.org/pypi/async_upnp_client
  34. .. image:: https://img.shields.io/pypi/l/async_upnp_client.svg
  35. :target: https://pypi.python.org/pypi/async_upnp_client
  36. Contributing
  37. ------------
  38. See `CONTRIBUTING.rst`.
  39. Usage
  40. -----
  41. See `examples/` for examples on how to use async_upnp_client.
  42. upnp-client
  43. -----------
  44. A command line interface is provided via the `upnp-client` script. This script can be used to:
  45. - call an action
  46. - subscribe to services and listen for events
  47. - show UPnP traffic (--debug-traffic) from and to the device
  48. - show pretty printed JSON (--pprint) for human readability
  49. - discover devices
  50. The output of the script is a single line of JSON for each action-call or subscription-event. See the programs help for more information.
  51. An example of calling an action::
  52. $ upnp-client --pprint call-action http://192.168.178.10:49152/description.xml RC/GetVolume InstanceID=0 Channel=Master
  53. {
  54. "timestamp": 1531482271.5603056,
  55. "service_id": "urn:upnp-org:serviceId:RenderingControl",
  56. "service_type": "urn:schemas-upnp-org:service:RenderingControl:1",
  57. "action": "GetVolume",
  58. "in_parameters": {
  59. "InstanceID": 0,
  60. "Channel": "Master"
  61. },
  62. "out_parameters": {
  63. "CurrentVolume": 70
  64. }
  65. }
  66. An example of subscribing to all services, note that the program stays running until you stop it (ctrl-c)::
  67. $ upnp-client --pprint subscribe http://192.168.178.10:49152/description.xml \*
  68. {
  69. "timestamp": 1531482518.3663802,
  70. "service_id": "urn:upnp-org:serviceId:RenderingControl",
  71. "service_type": "urn:schemas-upnp-org:service:RenderingControl:1",
  72. "state_variables": {
  73. "LastChange": "<Event xmlns=\"urn:schemas-upnp-org:metadata-1-0/AVT_RCS\">\n<InstanceID val=\"0\">\n<Mute channel=\"Master\" val=\"0\"/>\n<Volume channel=\"Master\" val=\"70\"/>\n</InstanceID>\n</Event>\n"
  74. }
  75. }
  76. {
  77. "timestamp": 1531482518.366804,
  78. "service_id": "urn:upnp-org:serviceId:RenderingControl",
  79. "service_type": "urn:schemas-upnp-org:service:RenderingControl:1",
  80. "state_variables": {
  81. "Mute": false,
  82. "Volume": 70
  83. }
  84. }
  85. ...
  86. You can subscribe to list of services by providing these names or abbreviated names, such as::
  87. $ upnp-client --pprint subscribe http://192.168.178.10:49152/description.xml RC AVTransport
  88. An example of discovering devices::
  89. $ upnp-client --pprint discover
  90. {
  91. "cache-control": "max-age=3600",
  92. "date": "Sat, 27 Oct 2018 10:43:42 GMT",
  93. "ext": "",
  94. "location": "http://192.168.178.1:49152/description.xml",
  95. "opt": "\"http://schemas.upnp.org/upnp/1/0/\"; ns=01",
  96. "01-nls": "906ad736-cfc4-11e8-9c22-8bb67c653324",
  97. "server": "Linux/4.14.26+, UPnP/1.0, Portable SDK for UPnP devices/1.6.20.jfd5",
  98. "x-user-agent": "redsonic",
  99. "st": "upnp:rootdevice",
  100. "usn": "uuid:e3a17dd5-9d85-3131-3c34-b827eb498d72::upnp:rootdevice",
  101. "_timestamp": "2018-10-27 12:43:09.125408"
  102. }
  103. Abstractions
  104. ------------
  105. - `DLNA Digital Media Renderer` (DLNA DMR) devices
  106. - Primarily built for use with `Home Assistant <https://github.com/home-assistant/home-assistant>`_, but might be useful in other projects too.
  107. - `Internet Gateway Devices` (IGD)
  108. - Printers