2019-05-13 08:16:55 +00:00
|
|
|
"""Consts for Cast integration."""
|
2024-03-08 13:51:32 +00:00
|
|
|
|
2024-01-08 08:45:37 +00:00
|
|
|
from __future__ import annotations
|
|
|
|
|
2024-02-15 19:14:01 +00:00
|
|
|
from typing import TYPE_CHECKING, TypedDict
|
2024-01-08 08:45:37 +00:00
|
|
|
|
|
|
|
from homeassistant.helpers.dispatcher import SignalType
|
|
|
|
|
|
|
|
if TYPE_CHECKING:
|
|
|
|
from .helpers import ChromecastInfo
|
|
|
|
|
2019-05-13 08:16:55 +00:00
|
|
|
|
2019-07-31 19:25:30 +00:00
|
|
|
DOMAIN = "cast"
|
2019-09-10 20:05:46 +00:00
|
|
|
|
|
|
|
# Stores a threading.Lock that is held by the internal pychromecast discovery.
|
|
|
|
INTERNAL_DISCOVERY_RUNNING_KEY = "cast_discovery_running"
|
|
|
|
# Stores UUIDs of cast devices that were added as entities. Doesn't store
|
|
|
|
# None UUIDs.
|
|
|
|
ADDED_CAST_DEVICES_KEY = "cast_added_cast_devices"
|
|
|
|
# Stores an audio group manager.
|
|
|
|
CAST_MULTIZONE_MANAGER_KEY = "cast_multizone_manager"
|
2021-03-01 23:18:18 +00:00
|
|
|
# Store a CastBrowser
|
|
|
|
CAST_BROWSER_KEY = "cast_browser"
|
2019-09-10 20:05:46 +00:00
|
|
|
|
|
|
|
# Dispatcher signal fired with a ChromecastInfo every time we discover a new
|
|
|
|
# Chromecast or receive it through configuration
|
2024-01-08 08:45:37 +00:00
|
|
|
SIGNAL_CAST_DISCOVERED: SignalType[ChromecastInfo] = SignalType("cast_discovered")
|
2019-09-10 20:05:46 +00:00
|
|
|
|
|
|
|
# Dispatcher signal fired with a ChromecastInfo every time a Chromecast is
|
|
|
|
# removed
|
2024-01-08 08:45:37 +00:00
|
|
|
SIGNAL_CAST_REMOVED: SignalType[ChromecastInfo] = SignalType("cast_removed")
|
2019-09-11 18:34:10 +00:00
|
|
|
|
|
|
|
# Dispatcher signal fired when a Chromecast should show a Home Assistant Cast view.
|
2024-01-08 08:45:37 +00:00
|
|
|
SIGNAL_HASS_CAST_SHOW_VIEW: SignalType[
|
2024-02-15 19:14:01 +00:00
|
|
|
HomeAssistantControllerData, str, str, str | None
|
2024-01-08 08:45:37 +00:00
|
|
|
] = SignalType("cast_show_view")
|
2021-03-01 23:18:18 +00:00
|
|
|
|
2021-03-25 13:06:01 +00:00
|
|
|
CONF_IGNORE_CEC = "ignore_cec"
|
2021-03-01 23:18:18 +00:00
|
|
|
CONF_KNOWN_HOSTS = "known_hosts"
|
2024-02-15 19:14:01 +00:00
|
|
|
|
|
|
|
|
|
|
|
class HomeAssistantControllerData(TypedDict):
|
|
|
|
"""Data for creating a HomeAssistantController."""
|
|
|
|
|
|
|
|
hass_url: str
|
|
|
|
hass_uuid: str
|
|
|
|
client_id: str | None
|
|
|
|
refresh_token: str
|