UPnP¶
Section [UPnP]¶
Added in version 1.0.0.dev11.
- UPnP.Port: int = 50001¶
Linked to
upnp.UPNPConfig.upnp_portSpecifies the port used by the UPNP server instance.
- UPnP.UUID: str¶
Linked to
upnp.UPNPConfig.upnp_uuidSpecifies the device UUID to use for this UPnP device. If not set, a random UUID at startup will be used.
- UPnP.TemplatesPath: List[str]¶
Linked to
upnp.UPNPConfig.upnp_templates_pathA list of directories that store extra UPnP profiles to be used by the web server. Note that only the target directory specified in
UPnP.Templatewill be used.
- UPnP.Template: str = "upnp-default"¶
Linked to
upnp.UPNPConfig.upnp_templateThe directory name under one of the template directories specified in
UPnP.TemplatesPaththat stores the device description, service description and presentation HTML.
Device Configuration¶
All template files specified here are using the templating language specified by Jinja2. By default,
the current UUID (uuid), the UPnP configuration (config), current session configuration (session)
and a factory method for random values (random) are accessible within the template.
- UPnP.DDUri: str = "/dd.xml"¶
Linked to
upnp.UPNPConfig.upnp_dd_pathDefines the URI and path to the local device description template. By default, the device description is expected to be found in
dd.xmlwithin the template directory.The default template corresponds to:
<?xml version="1.0"?> <root xmlns="urn:schemas-upnp-org:device-1-0" configId="1337"> <specVersion> <major>1</major> <minor>0</minor> </specVersion> <device> <deviceType>urn:schemas-upnp-org:device:Basic:1</deviceType> <friendlyName>Dementor</friendlyName> <manufacturer>Manufacturer</manufacturer> <manufacturerURL>http://{{session.ipv4}}/manufacturer/</manufacturerURL> <modelDescription>user-friendly computer</modelDescription> <modelName>Office Computer</modelName> <modelNumber>COM{{ random(5) }}</modelNumber> <modelURL>http://{{session.ipv4}}/model</modelURL> <serialNumber>{{ random(10) }}</serialNumber> <UDN>uuid:{{uuid}}</UDN> <UPC>00000000000</UPC> <serviceList> <service> <serviceType>urn:schemas-upnp-org:service:Dummy:1</serviceType> <serviceId>urn:upnp-org:serviceId:Dummy</serviceId> <SCPDURL>/{{uuid}}/{{config.upnp_scpd_path}}</SCPDURL> <controlURL>/{{uuid}}/{{config.upnp_scpd_path}}</controlURL> <eventSubURL>/{{uuid}}/{{config.upnp_scpd_path}}</eventSubURL> </service> </serviceList> <deviceList> </deviceList> <presentationURL>http://{{session.ipv4}}:{{config.upnp_port}}/present.html</presentationURL> </device> </root>
- UPnP.SCPDUri: str = "/scpd.xml"¶
Linked to
upnp.UPNPConfig.upnp_scpd_pathDefines the URI and path to the local service control description template. By default, the service description is expected to be found in
scpd.xmlwithin the template directory.
- UPnP.PresentationUri: str = "/present.html"¶
Linked to
upnp.UPNPConfig.upnp_present_pathDefines the URI and path to the presentation page template.
Default Configuration¶
1[UPnP]
2Port = 50001
3Template = "upnp-default"
4DDUri = "/dd.xml"
5SCPDUri = "/scpd.xml"
6PresentationUri = "/present.html"