core/homeassistant/components/media_source/const.py

17 lines
468 B
Python
Raw Normal View History

"""Constants for the media_source integration."""
import re
2022-09-12 18:06:27 +00:00
from homeassistant.components.media_player import MediaClass
DOMAIN = "media_source"
MEDIA_MIME_TYPES = ("audio", "video", "image")
MEDIA_CLASS_MAP = {
2022-09-12 18:06:27 +00:00
"audio": MediaClass.MUSIC,
"video": MediaClass.VIDEO,
"image": MediaClass.IMAGE,
}
URI_SCHEME = "media-source://"
URI_SCHEME_REGEX = re.compile(
r"^media-source:\/\/(?:(?P<domain>(?!_)[\da-z_]+(?<!_))(?:\/(?P<identifier>(?!\/).+))?)?$"
)