Home Assistant Unofficial Reference 2024.12.1
homeassistant.components.dlna_dms.dms.DmsDeviceSource Class Reference

Public Member Functions

None __init__ (self, HomeAssistant hass, ConfigEntry config_entry)
 
None async_added_to_hass (self)
 
BrowseMediaSource async_browse_media (self, str|None identifier)
 
BrowseMediaSource async_browse_object (self, str object_id)
 
BrowseMediaSource async_browse_search (self, str query)
 
DidlPlayMedia async_resolve_media (self, str identifier)
 
DidlPlayMedia async_resolve_object (self, str object_id)
 
str async_resolve_path (self, str path)
 
DidlPlayMedia async_resolve_search (self, str query)
 
None async_ssdp_callback (self, ssdp.SsdpServiceInfo info, ssdp.SsdpChange change)
 
None async_will_remove_from_hass (self)
 
bool available (self)
 
None device_connect (self)
 
None device_disconnect (self)
 
str|None icon (self)
 
str name (self)
 
str source_id (self)
 
str udn (self)
 
str usn (self)
 

Public Attributes

 config_entry
 
 hass
 
 location
 

Static Public Attributes

 bool
 
 None
 

Private Member Functions

str|None _didl_thumbnail_url (self, didl_lite.DidlObject item)
 
BrowseMediaSource _didl_to_media_source (self, didl_lite.DidlObject item, DmsDevice.BrowseResult|None browsed_children=None)
 
DidlPlayMedia _didl_to_play_media (self, didl_lite.DidlObject item)
 
str _make_identifier (self, Action action, str object_id)
 
list[str] _sort_criteria (self)
 

Private Attributes

 _bootid
 
 _device
 
 _device_lock
 
 _ssdp_connect_failed
 

Detailed Description

DMS Device wrapper, providing media files as a media_source.

Definition at line 163 of file dms.py.

Constructor & Destructor Documentation

◆ __init__()

None homeassistant.components.dlna_dms.dms.DmsDeviceSource.__init__ (   self,
HomeAssistant  hass,
ConfigEntry  config_entry 
)
Initialize a DMS Source.

Definition at line 180 of file dms.py.

Member Function Documentation

◆ _didl_thumbnail_url()

str | None homeassistant.components.dlna_dms.dms.DmsDeviceSource._didl_thumbnail_url (   self,
didl_lite.DidlObject  item 
)
private
Return absolute URL of a thumbnail for a DIDL-Lite object.

Some objects have the thumbnail in albumArtURI, others in an image
resource.

Definition at line 596 of file dms.py.

◆ _didl_to_media_source()

BrowseMediaSource homeassistant.components.dlna_dms.dms.DmsDeviceSource._didl_to_media_source (   self,
didl_lite.DidlObject  item,
DmsDevice.BrowseResult | None   browsed_children = None 
)
private
Convert a DIDL-Lite object to a browse media source.

Definition at line 549 of file dms.py.

◆ _didl_to_play_media()

DidlPlayMedia homeassistant.components.dlna_dms.dms.DmsDeviceSource._didl_to_play_media (   self,
didl_lite.DidlObject  item 
)
private
Return the first playable resource from a DIDL-Lite object.

Definition at line 530 of file dms.py.

◆ _make_identifier()

str homeassistant.components.dlna_dms.dms.DmsDeviceSource._make_identifier (   self,
Action  action,
str  object_id 
)
private
Make an identifier for BrowseMediaSource.

Definition at line 616 of file dms.py.

◆ _sort_criteria()

list[str] homeassistant.components.dlna_dms.dms.DmsDeviceSource._sort_criteria (   self)
private
Return criteria to be used for sorting results.

The device must be connected before reading this property.

Definition at line 621 of file dms.py.

◆ async_added_to_hass()

None homeassistant.components.dlna_dms.dms.DmsDeviceSource.async_added_to_hass (   self)
Handle addition of this source.

Definition at line 189 of file dms.py.

◆ async_browse_media()

BrowseMediaSource homeassistant.components.dlna_dms.dms.DmsDeviceSource.async_browse_media (   self,
str | None  identifier 
)
Browse media.

Definition at line 377 of file dms.py.

◆ async_browse_object()

BrowseMediaSource homeassistant.components.dlna_dms.dms.DmsDeviceSource.async_browse_object (   self,
str  object_id 
)
Return the contents of a DLNA container by ObjectID.

Definition at line 486 of file dms.py.

◆ async_browse_search()

BrowseMediaSource homeassistant.components.dlna_dms.dms.DmsDeviceSource.async_browse_search (   self,
str  query 
)
Return all media items found by the query string.

Definition at line 503 of file dms.py.

◆ async_resolve_media()

DidlPlayMedia homeassistant.components.dlna_dms.dms.DmsDeviceSource.async_resolve_media (   self,
str  identifier 
)
Resolve a media item to a playable item.

Definition at line 360 of file dms.py.

◆ async_resolve_object()

DidlPlayMedia homeassistant.components.dlna_dms.dms.DmsDeviceSource.async_resolve_object (   self,
str  object_id 
)
Return a playable media item specified by ObjectID.

Definition at line 397 of file dms.py.

◆ async_resolve_path()

str homeassistant.components.dlna_dms.dms.DmsDeviceSource.async_resolve_path (   self,
str  path 
)
Return an Object ID resolved from a path string.

Definition at line 409 of file dms.py.

◆ async_resolve_search()

DidlPlayMedia homeassistant.components.dlna_dms.dms.DmsDeviceSource.async_resolve_search (   self,
str  query 
)
Return first playable media item found by the query string.

Definition at line 463 of file dms.py.

◆ async_ssdp_callback()

None homeassistant.components.dlna_dms.dms.DmsDeviceSource.async_ssdp_callback (   self,
ssdp.SsdpServiceInfo  info,
ssdp.SsdpChange   change 
)
Handle notification from SSDP of device state change.

Definition at line 222 of file dms.py.

◆ async_will_remove_from_hass()

None homeassistant.components.dlna_dms.dms.DmsDeviceSource.async_will_remove_from_hass (   self)
Handle removal of this source.

Definition at line 218 of file dms.py.

◆ available()

bool homeassistant.components.dlna_dms.dms.DmsDeviceSource.available (   self)
Device is available when we have a connection to it.

Definition at line 329 of file dms.py.

◆ device_connect()

None homeassistant.components.dlna_dms.dms.DmsDeviceSource.device_connect (   self)
Connect to the device now that it's available.

Definition at line 288 of file dms.py.

◆ device_disconnect()

None homeassistant.components.dlna_dms.dms.DmsDeviceSource.device_disconnect (   self)
Destroy connections to the device now that it's not available.

Also call when removing this device wrapper from hass to clean up connections.

Definition at line 312 of file dms.py.

◆ icon()

str | None homeassistant.components.dlna_dms.dms.DmsDeviceSource.icon (   self)
Return an URL to an icon for the media server.

Definition at line 354 of file dms.py.

◆ name()

str homeassistant.components.dlna_dms.dms.DmsDeviceSource.name (   self)
Return a name for the media server.

Definition at line 344 of file dms.py.

◆ source_id()

str homeassistant.components.dlna_dms.dms.DmsDeviceSource.source_id (   self)
Return a unique ID (slug) for this source for people to use in URLs.

Definition at line 349 of file dms.py.

◆ udn()

str homeassistant.components.dlna_dms.dms.DmsDeviceSource.udn (   self)
Get the UDN (Unique Device Name) based on the USN.

Definition at line 339 of file dms.py.

◆ usn()

str homeassistant.components.dlna_dms.dms.DmsDeviceSource.usn (   self)
Get the USN (Unique Service Name) for the wrapped UPnP device end-point.

Definition at line 334 of file dms.py.

Member Data Documentation

◆ _bootid

homeassistant.components.dlna_dms.dms.DmsDeviceSource._bootid
private

Definition at line 241 of file dms.py.

◆ _device

homeassistant.components.dlna_dms.dms.DmsDeviceSource._device
private

Definition at line 306 of file dms.py.

◆ _device_lock

homeassistant.components.dlna_dms.dms.DmsDeviceSource._device_lock
private

Definition at line 185 of file dms.py.

◆ _ssdp_connect_failed

homeassistant.components.dlna_dms.dms.DmsDeviceSource._ssdp_connect_failed
private

Definition at line 255 of file dms.py.

◆ bool

homeassistant.components.dlna_dms.dms.DmsDeviceSource.bool
static

Definition at line 175 of file dms.py.

◆ config_entry

homeassistant.components.dlna_dms.dms.DmsDeviceSource.config_entry

Definition at line 183 of file dms.py.

◆ hass

homeassistant.components.dlna_dms.dms.DmsDeviceSource.hass

Definition at line 182 of file dms.py.

◆ location

homeassistant.components.dlna_dms.dms.DmsDeviceSource.location

Definition at line 184 of file dms.py.

◆ None

homeassistant.components.dlna_dms.dms.DmsDeviceSource.None
static

Definition at line 172 of file dms.py.


The documentation for this class was generated from the following file: