Follow changes to netdisco, separating DLNA into DLNA_DMS and DLNA_DMR (#15877)

* Follow changes to netdisco, separating DLNA into DLNA_DMS and DLNA_DMR

* No uppercase for names of netdisco discoverables
pull/15855/merge
Steven Looman 2018-08-08 11:54:22 +02:00 committed by Fabian Affolter
parent debdc707e9
commit 0ab65f1ac5
2 changed files with 1 additions and 15 deletions

View File

@ -85,7 +85,7 @@ SERVICE_HANDLERS = {
'volumio': ('media_player', 'volumio'), 'volumio': ('media_player', 'volumio'),
'nanoleaf_aurora': ('light', 'nanoleaf_aurora'), 'nanoleaf_aurora': ('light', 'nanoleaf_aurora'),
'freebox': ('device_tracker', 'freebox'), 'freebox': ('device_tracker', 'freebox'),
'DLNA': ('media_player', 'dlna_dmr') 'dlna_dmr': ('media_player', 'dlna_dmr'),
} }
OPTIONAL_SERVICE_HANDLERS = { OPTIONAL_SERVICE_HANDLERS = {

View File

@ -67,11 +67,6 @@ HOME_ASSISTANT_UPNP_MIME_TYPE_MAPPING = {
'channel': 'video/*', 'channel': 'video/*',
'playlist': 'playlist/*', 'playlist': 'playlist/*',
} }
UPNP_DEVICE_MEDIA_RENDERER = [
'urn:schemas-upnp-org:device:MediaRenderer:1',
'urn:schemas-upnp-org:device:MediaRenderer:2',
'urn:schemas-upnp-org:device:MediaRenderer:3',
]
_LOGGER = logging.getLogger(__name__) _LOGGER = logging.getLogger(__name__)
@ -126,15 +121,6 @@ async def async_setup_platform(hass: HomeAssistant,
async_add_devices, async_add_devices,
discovery_info=None): discovery_info=None):
"""Set up DLNA DMR platform.""" """Set up DLNA DMR platform."""
# ensure this is a DLNA DMR device, if found via discovery
if discovery_info and \
'upnp_device_type' in discovery_info and \
discovery_info['upnp_device_type'] not in UPNP_DEVICE_MEDIA_RENDERER:
_LOGGER.debug('Device is not a MediaRenderer: %s, device_type: %s',
discovery_info.get('ssdp_description'),
discovery_info['upnp_device_type'])
return
if config.get(CONF_URL) is not None: if config.get(CONF_URL) is not None:
url = config[CONF_URL] url = config[CONF_URL]
name = config.get(CONF_NAME) name = config.get(CONF_NAME)