2020-09-04 15:16:29 +00:00
|
|
|
"""Constants for the media_source integration."""
|
|
|
|
import re
|
|
|
|
|
2022-09-12 18:06:27 +00:00
|
|
|
from homeassistant.components.media_player import MediaClass
|
2020-09-09 20:19:30 +00:00
|
|
|
|
2020-09-04 15:16:29 +00:00
|
|
|
DOMAIN = "media_source"
|
|
|
|
MEDIA_MIME_TYPES = ("audio", "video", "image")
|
2020-09-09 20:19:30 +00:00
|
|
|
MEDIA_CLASS_MAP = {
|
2022-09-12 18:06:27 +00:00
|
|
|
"audio": MediaClass.MUSIC,
|
|
|
|
"video": MediaClass.VIDEO,
|
|
|
|
"image": MediaClass.IMAGE,
|
2020-09-09 20:19:30 +00:00
|
|
|
}
|
2020-09-04 15:16:29 +00:00
|
|
|
URI_SCHEME = "media-source://"
|
2020-09-16 13:28:25 +00:00
|
|
|
URI_SCHEME_REGEX = re.compile(
|
2020-10-14 19:02:08 +00:00
|
|
|
r"^media-source:\/\/(?:(?P<domain>(?!_)[\da-z_]+(?<!_))(?:\/(?P<identifier>(?!\/).+))?)?$"
|
2020-09-16 13:28:25 +00:00
|
|
|
)
|