mirror of
https://github.com/home-assistant/core.git
synced 2025-04-23 16:57:53 +00:00
Make Bang & Olufsen products ignore .m3u media source files (#120317)
This commit is contained in:
parent
72d1b3e360
commit
d0961ca473
@ -45,6 +45,7 @@ from homeassistant.components.media_player import (
|
||||
from homeassistant.config_entries import ConfigEntry
|
||||
from homeassistant.const import CONF_MODEL
|
||||
from homeassistant.core import HomeAssistant, callback
|
||||
from homeassistant.exceptions import HomeAssistantError
|
||||
from homeassistant.helpers.device_registry import DeviceInfo
|
||||
from homeassistant.helpers.dispatcher import async_dispatcher_connect
|
||||
from homeassistant.helpers.entity_platform import AddEntitiesCallback
|
||||
@ -572,9 +573,11 @@ class BangOlufsenMediaPlayer(BangOlufsenEntity, MediaPlayerEntity):
|
||||
|
||||
media_id = async_process_play_media_url(self.hass, sourced_media.url)
|
||||
|
||||
# Remove playlist extension as it is unsupported.
|
||||
# Exit if the source uses unsupported file.
|
||||
if media_id.endswith(".m3u"):
|
||||
media_id = media_id.replace(".m3u", "")
|
||||
raise HomeAssistantError(
|
||||
translation_domain=DOMAIN, translation_key="m3u_invalid_format"
|
||||
)
|
||||
|
||||
if announce:
|
||||
extra = kwargs.get(ATTR_MEDIA_EXTRA, {})
|
||||
|
@ -24,5 +24,10 @@
|
||||
"description": "Confirm the configuration of the {model}-{serial_number} @ {host}."
|
||||
}
|
||||
}
|
||||
},
|
||||
"exceptions": {
|
||||
"m3u_invalid_format": {
|
||||
"message": "Media sources with the .m3u extension are not supported."
|
||||
}
|
||||
}
|
||||
}
|
||||
|
Loading…
x
Reference in New Issue
Block a user