diff --git a/homeassistant/components/reolink/camera.py b/homeassistant/components/reolink/camera.py index 0fe08af5ab2..5ad3679565f 100644 --- a/homeassistant/components/reolink/camera.py +++ b/homeassistant/components/reolink/camera.py @@ -31,6 +31,9 @@ async def async_setup_entry( streams.append("ext") for stream in streams: + stream_url = await host.api.get_stream_source(channel, stream) + if stream_url is None and stream != "snapshots": + continue cameras.append(ReolinkCamera(reolink_data, config_entry, channel, stream)) async_add_entities(cameras, update_before_add=True) diff --git a/homeassistant/components/reolink/host.py b/homeassistant/components/reolink/host.py index dcf1f5e526e..6f4487d2001 100644 --- a/homeassistant/components/reolink/host.py +++ b/homeassistant/components/reolink/host.py @@ -128,7 +128,7 @@ class ReolinkHost: async def disconnect(self): """Disconnect from the API, so the connection will be released.""" - await self._api.unsubscribe_all() + await self._api.unsubscribe() try: await self._api.logout() diff --git a/homeassistant/components/reolink/manifest.json b/homeassistant/components/reolink/manifest.json index b65400ad952..92b0a0b9c1b 100644 --- a/homeassistant/components/reolink/manifest.json +++ b/homeassistant/components/reolink/manifest.json @@ -3,7 +3,7 @@ "name": "Reolink IP NVR/camera", "config_flow": true, "documentation": "https://www.home-assistant.io/integrations/reolink", - "requirements": ["reolink-aio==0.2.2"], + "requirements": ["reolink-aio==0.2.3"], "codeowners": ["@starkillerOG"], "iot_class": "local_polling", "loggers": ["reolink_aio"] diff --git a/requirements_all.txt b/requirements_all.txt index 91d73151c01..a47d89e1823 100644 --- a/requirements_all.txt +++ b/requirements_all.txt @@ -2212,7 +2212,7 @@ regenmaschine==2022.11.0 renault-api==0.1.11 # homeassistant.components.reolink -reolink-aio==0.2.2 +reolink-aio==0.2.3 # homeassistant.components.python_script restrictedpython==6.0 diff --git a/requirements_test_all.txt b/requirements_test_all.txt index 96942b971e3..b0822e2a2f6 100644 --- a/requirements_test_all.txt +++ b/requirements_test_all.txt @@ -1557,7 +1557,7 @@ regenmaschine==2022.11.0 renault-api==0.1.11 # homeassistant.components.reolink -reolink-aio==0.2.2 +reolink-aio==0.2.3 # homeassistant.components.python_script restrictedpython==6.0 diff --git a/tests/components/reolink/test_config_flow.py b/tests/components/reolink/test_config_flow.py index 013c399d17b..95d43d59d71 100644 --- a/tests/components/reolink/test_config_flow.py +++ b/tests/components/reolink/test_config_flow.py @@ -31,7 +31,7 @@ def get_mock_info(error=None, user_level="admin"): host_mock.get_host_data = AsyncMock(return_value=None) else: host_mock.get_host_data = AsyncMock(side_effect=error) - host_mock.unsubscribe_all = AsyncMock(return_value=True) + host_mock.unsubscribe = AsyncMock(return_value=True) host_mock.logout = AsyncMock(return_value=True) host_mock.mac_address = TEST_MAC host_mock.onvif_enabled = True