mirror of
https://github.com/home-assistant/core.git
synced 2026-12-02 11:33:11 -04:00
Use the MIME type as the Nest event media content type (#195931)
Co-authored-by: Claude Opus 5.5 <noreply@anthropic.com>
This commit is contained in:
co-authored by
Claude Opus 5.5
parent
3764f36c36
commit
25b3538869
@@ -608,7 +608,8 @@ def _browse_clip_preview(
|
||||
domain=DOMAIN,
|
||||
identifier=event_id.identifier,
|
||||
media_class=MediaClass.IMAGE,
|
||||
media_content_type=MediaType.IMAGE,
|
||||
# Media pickers filter on MIME types, such as image/*.
|
||||
media_content_type=EventImageType.CLIP_PREVIEW.content_type,
|
||||
title=CLIP_TITLE_FORMAT.format(
|
||||
event_name=", ".join(types),
|
||||
event_time=dt_util.as_local(event.timestamp).strftime(DATE_STR_FORMAT),
|
||||
@@ -630,7 +631,7 @@ def _browse_image_event(
|
||||
domain=DOMAIN,
|
||||
identifier=event_id.identifier,
|
||||
media_class=MediaClass.IMAGE,
|
||||
media_content_type=MediaType.IMAGE,
|
||||
media_content_type=EventImageType.IMAGE.content_type,
|
||||
title=CLIP_TITLE_FORMAT.format(
|
||||
event_name=MEDIA_SOURCE_EVENT_TITLE_MAP.get(event.event_type, "Event"),
|
||||
event_time=dt_util.as_local(event.timestamp).strftime(DATE_STR_FORMAT),
|
||||
|
||||
@@ -400,6 +400,7 @@ async def test_camera_event(
|
||||
assert browse.domain == DOMAIN
|
||||
assert browse.identifier == f"{device.id}/{event_identifier}"
|
||||
assert "Person" in browse.title
|
||||
assert browse.media_content_type == "image/jpeg"
|
||||
assert not browse.can_expand
|
||||
assert not browse.children
|
||||
assert not browse.can_play
|
||||
@@ -915,6 +916,7 @@ async def test_camera_event_clip_preview(
|
||||
assert browse.domain == DOMAIN
|
||||
event_timestamp_string = event_timestamp.strftime(DATE_STR_FORMAT)
|
||||
assert browse.title == f"Motion @ {event_timestamp_string}"
|
||||
assert browse.media_content_type == "video/mp4"
|
||||
assert not browse.can_expand
|
||||
assert len(browse.children) == 0
|
||||
assert browse.can_play
|
||||
|
||||
Reference in New Issue
Block a user