From 4a9d545ffeab00a5bfaa768eb4d588bf7f7d377f Mon Sep 17 00:00:00 2001 From: starkillerOG Date: Tue, 31 Dec 2024 10:31:40 +0100 Subject: [PATCH] Bump reolink-aio to 0.11.6 (#134286) --- homeassistant/components/reolink/camera.py | 2 +- homeassistant/components/reolink/manifest.json | 2 +- homeassistant/components/reolink/media_source.py | 2 ++ homeassistant/components/reolink/strings.json | 1 + requirements_all.txt | 2 +- requirements_test_all.txt | 2 +- tests/components/reolink/test_media_source.py | 8 +++++++- 7 files changed, 14 insertions(+), 5 deletions(-) diff --git a/homeassistant/components/reolink/camera.py b/homeassistant/components/reolink/camera.py index d9b3cb67f70..a597be3ec7a 100644 --- a/homeassistant/components/reolink/camera.py +++ b/homeassistant/components/reolink/camera.py @@ -100,7 +100,7 @@ async def async_setup_entry( if not entity_description.supported(reolink_data.host.api, channel): continue stream_url = await reolink_data.host.api.get_stream_source( - channel, entity_description.stream + channel, entity_description.stream, False ) if stream_url is None and "snapshots" not in entity_description.stream: continue diff --git a/homeassistant/components/reolink/manifest.json b/homeassistant/components/reolink/manifest.json index e5e8afc1d63..7d01ca808e1 100644 --- a/homeassistant/components/reolink/manifest.json +++ b/homeassistant/components/reolink/manifest.json @@ -19,5 +19,5 @@ "iot_class": "local_push", "loggers": ["reolink_aio"], "quality_scale": "platinum", - "requirements": ["reolink-aio==0.11.5"] + "requirements": ["reolink-aio==0.11.6"] } diff --git a/homeassistant/components/reolink/media_source.py b/homeassistant/components/reolink/media_source.py index 0c23bed7e2f..538a06a08f8 100644 --- a/homeassistant/components/reolink/media_source.py +++ b/homeassistant/components/reolink/media_source.py @@ -81,6 +81,8 @@ class ReolinkVODMediaSource(MediaSource): def get_vod_type() -> VodRequestType: if filename.endswith(".mp4"): + if host.api.is_nvr: + return VodRequestType.DOWNLOAD return VodRequestType.PLAYBACK if host.api.is_nvr: return VodRequestType.FLV diff --git a/homeassistant/components/reolink/strings.json b/homeassistant/components/reolink/strings.json index 283c1d42e89..50163fa1aca 100644 --- a/homeassistant/components/reolink/strings.json +++ b/homeassistant/components/reolink/strings.json @@ -567,6 +567,7 @@ "stayoff": "Stay off", "auto": "[%key:component::reolink::entity::select::day_night_mode::state::auto%]", "alwaysonatnight": "Auto & always on at night", + "always": "Always on", "alwayson": "Always on" } }, diff --git a/requirements_all.txt b/requirements_all.txt index 349942299b6..49518a92c75 100644 --- a/requirements_all.txt +++ b/requirements_all.txt @@ -2575,7 +2575,7 @@ renault-api==0.2.8 renson-endura-delta==1.7.2 # homeassistant.components.reolink -reolink-aio==0.11.5 +reolink-aio==0.11.6 # homeassistant.components.idteck_prox rfk101py==0.0.1 diff --git a/requirements_test_all.txt b/requirements_test_all.txt index e51cffc9ed5..bb850c602d9 100644 --- a/requirements_test_all.txt +++ b/requirements_test_all.txt @@ -2075,7 +2075,7 @@ renault-api==0.2.8 renson-endura-delta==1.7.2 # homeassistant.components.reolink -reolink-aio==0.11.5 +reolink-aio==0.11.6 # homeassistant.components.rflink rflink==0.0.66 diff --git a/tests/components/reolink/test_media_source.py b/tests/components/reolink/test_media_source.py index 32afd1f73ca..9c5be08e9b6 100644 --- a/tests/components/reolink/test_media_source.py +++ b/tests/components/reolink/test_media_source.py @@ -109,11 +109,17 @@ async def test_resolve( ) assert play_media.mime_type == TEST_MIME_TYPE_MP4 + reolink_connect.is_nvr = False + + play_media = await async_resolve_media( + hass, f"{URI_SCHEME}{DOMAIN}/{file_id}", None + ) + assert play_media.mime_type == TEST_MIME_TYPE_MP4 + file_id = ( f"FILE|{config_entry.entry_id}|{TEST_CHANNEL}|{TEST_STREAM}|{TEST_FILE_NAME}" ) reolink_connect.get_vod_source.return_value = (TEST_MIME_TYPE, TEST_URL) - reolink_connect.is_nvr = False play_media = await async_resolve_media( hass, f"{URI_SCHEME}{DOMAIN}/{file_id}", None