diff --git a/homeassistant/components/google_assistant/trait.py b/homeassistant/components/google_assistant/trait.py index 5d2d59f2144..653324758e0 100644 --- a/homeassistant/components/google_assistant/trait.py +++ b/homeassistant/components/google_assistant/trait.py @@ -29,6 +29,7 @@ from homeassistant.const import ( ATTR_ENTITY_ID, ATTR_SUPPORTED_FEATURES, ATTR_TEMPERATURE, + CAST_APP_ID_HOMEASSISTANT, SERVICE_ALARM_ARM_AWAY, SERVICE_ALARM_ARM_CUSTOM_BYPASS, SERVICE_ALARM_ARM_HOME, @@ -287,7 +288,10 @@ class CameraStreamTrait(_Trait): url = await self.hass.components.camera.async_request_stream( self.state.entity_id, "hls" ) - self.stream_info = {"cameraStreamAccessUrl": f"{get_url(self.hass)}{url}"} + self.stream_info = { + "cameraStreamAccessUrl": f"{get_url(self.hass)}{url}", + "cameraStreamReceiverAppId": CAST_APP_ID_HOMEASSISTANT, + } @register_trait diff --git a/homeassistant/const.py b/homeassistant/const.py index 7e695cb28ab..cd093b4e9fa 100644 --- a/homeassistant/const.py +++ b/homeassistant/const.py @@ -608,3 +608,6 @@ PRECISION_TENTHS = 0.1 # Static list of entities that will never be exposed to # cloud, alexa, or google_home components CLOUD_NEVER_EXPOSED_ENTITIES = ["group.all_locks"] + +# The ID of the Home Assistant Cast App +CAST_APP_ID_HOMEASSISTANT = "B12CE3CA" diff --git a/tests/components/google_assistant/test_smart_home.py b/tests/components/google_assistant/test_smart_home.py index 78d403c2038..f35415ee9e4 100644 --- a/tests/components/google_assistant/test_smart_home.py +++ b/tests/components/google_assistant/test_smart_home.py @@ -976,6 +976,7 @@ async def test_trait_execute_adding_query_data(hass): "states": { "online": True, "cameraStreamAccessUrl": "https://example.com/api/streams/bla", + "cameraStreamReceiverAppId": "B12CE3CA", }, } ] diff --git a/tests/components/google_assistant/test_trait.py b/tests/components/google_assistant/test_trait.py index ac0db986f42..d415c4f2476 100644 --- a/tests/components/google_assistant/test_trait.py +++ b/tests/components/google_assistant/test_trait.py @@ -135,7 +135,8 @@ async def test_camera_stream(hass): await trt.execute(trait.COMMAND_GET_CAMERA_STREAM, BASIC_DATA, {}, {}) assert trt.query_attributes() == { - "cameraStreamAccessUrl": "https://example.com/api/streams/bla" + "cameraStreamAccessUrl": "https://example.com/api/streams/bla", + "cameraStreamReceiverAppId": "B12CE3CA", }