Google Cast: Use own media player app (#55524)
This commit is contained in:
parent
20f0a6730b
commit
47b6755177
5 changed files with 12 additions and 7 deletions
|
@ -46,6 +46,7 @@ from homeassistant.components.media_player.const import (
|
|||
from homeassistant.components.plex.const import PLEX_URI_SCHEME
|
||||
from homeassistant.components.plex.services import lookup_plex_media
|
||||
from homeassistant.const import (
|
||||
CAST_APP_ID_HOMEASSISTANT_MEDIA,
|
||||
EVENT_HOMEASSISTANT_STOP,
|
||||
STATE_IDLE,
|
||||
STATE_OFF,
|
||||
|
@ -244,6 +245,7 @@ class CastDevice(MediaPlayerEntity):
|
|||
),
|
||||
ChromeCastZeroconf.get_zeroconf(),
|
||||
)
|
||||
chromecast.media_controller.app_id = CAST_APP_ID_HOMEASSISTANT_MEDIA
|
||||
self._chromecast = chromecast
|
||||
|
||||
if CAST_MULTIZONE_MANAGER_KEY not in self.hass.data:
|
||||
|
@ -816,6 +818,7 @@ class DynamicCastGroup:
|
|||
),
|
||||
ChromeCastZeroconf.get_zeroconf(),
|
||||
)
|
||||
chromecast.media_controller.app_id = CAST_APP_ID_HOMEASSISTANT_MEDIA
|
||||
self._chromecast = chromecast
|
||||
|
||||
if CAST_MULTIZONE_MANAGER_KEY not in self.hass.data:
|
||||
|
|
|
@ -35,7 +35,7 @@ from homeassistant.const import (
|
|||
ATTR_MODE,
|
||||
ATTR_SUPPORTED_FEATURES,
|
||||
ATTR_TEMPERATURE,
|
||||
CAST_APP_ID_HOMEASSISTANT,
|
||||
CAST_APP_ID_HOMEASSISTANT_MEDIA,
|
||||
SERVICE_ALARM_ARM_AWAY,
|
||||
SERVICE_ALARM_ARM_CUSTOM_BYPASS,
|
||||
SERVICE_ALARM_ARM_HOME,
|
||||
|
@ -307,7 +307,7 @@ class CameraStreamTrait(_Trait):
|
|||
)
|
||||
self.stream_info = {
|
||||
"cameraStreamAccessUrl": f"{get_url(self.hass)}{url}",
|
||||
"cameraStreamReceiverAppId": CAST_APP_ID_HOMEASSISTANT,
|
||||
"cameraStreamReceiverAppId": CAST_APP_ID_HOMEASSISTANT_MEDIA,
|
||||
}
|
||||
|
||||
|
||||
|
|
|
@ -695,9 +695,6 @@ PRECISION_TENTHS: Final = 0.1
|
|||
# cloud, alexa, or google_home components
|
||||
CLOUD_NEVER_EXPOSED_ENTITIES: Final[list[str]] = ["group.all_locks"]
|
||||
|
||||
# The ID of the Home Assistant Cast App
|
||||
CAST_APP_ID_HOMEASSISTANT: Final = "B12CE3CA"
|
||||
|
||||
ENTITY_CATEGORY_CONFIG: Final = "config"
|
||||
ENTITY_CATEGORY_DIAGNOSTIC: Final = "diagnostic"
|
||||
ENTITY_CATEGORY_SYSTEM: Final = "system"
|
||||
|
@ -710,3 +707,8 @@ ENTITY_CATEGORIES: Final[list[str]] = [
|
|||
ENTITY_CATEGORY_DIAGNOSTIC,
|
||||
ENTITY_CATEGORY_SYSTEM,
|
||||
]
|
||||
|
||||
# The ID of the Home Assistant Media Player Cast App
|
||||
CAST_APP_ID_HOMEASSISTANT_MEDIA: Final = "B45F4572"
|
||||
# The ID of the Home Assistant Lovelace Cast App
|
||||
CAST_APP_ID_HOMEASSISTANT_LOVELACE: Final = "A078F6B0"
|
||||
|
|
|
@ -940,7 +940,7 @@ async def test_trait_execute_adding_query_data(hass):
|
|||
"states": {
|
||||
"online": True,
|
||||
"cameraStreamAccessUrl": "https://example.com/api/streams/bla",
|
||||
"cameraStreamReceiverAppId": "B12CE3CA",
|
||||
"cameraStreamReceiverAppId": "B45F4572",
|
||||
},
|
||||
}
|
||||
]
|
||||
|
|
|
@ -146,7 +146,7 @@ async def test_camera_stream(hass):
|
|||
|
||||
assert trt.query_attributes() == {
|
||||
"cameraStreamAccessUrl": "https://example.com/api/streams/bla",
|
||||
"cameraStreamReceiverAppId": "B12CE3CA",
|
||||
"cameraStreamReceiverAppId": "B45F4572",
|
||||
}
|
||||
|
||||
|
||||
|
|
Loading…
Add table
Reference in a new issue