Home Assistant Unofficial Reference 2024.12.1
const.py
Go to the documentation of this file.
1 """Constants for the media_source integration."""
2 
3 import re
4 
5 from homeassistant.components.media_player import MediaClass
6 
7 DOMAIN = "media_source"
8 MEDIA_MIME_TYPES = ("audio", "video", "image")
9 MEDIA_CLASS_MAP = {
10  "audio": MediaClass.MUSIC,
11  "video": MediaClass.VIDEO,
12  "image": MediaClass.IMAGE,
13 }
14 URI_SCHEME = "media-source://"
15 URI_SCHEME_REGEX = re.compile(
16  r"^media-source:\/\/(?:(?P<domain>(?!_)[\da-z_]+(?<!_))(?:\/(?P<identifier>(?!\/).+))?)?$"
17 )