diff --git a/homeassistant/components/reolink/__init__.py b/homeassistant/components/reolink/__init__.py index a5050d3c436..923df261d84 100644 --- a/homeassistant/components/reolink/__init__.py +++ b/homeassistant/components/reolink/__init__.py @@ -8,7 +8,6 @@ from datetime import timedelta import logging from typing import Literal -from aiohttp import ClientConnectorError import async_timeout from reolink_aio.exceptions import CredentialsInvalidError, ReolinkError @@ -58,8 +57,6 @@ async def async_setup_entry(hass: HomeAssistant, config_entry: ConfigEntry) -> b await host.stop() raise ConfigEntryAuthFailed(err) from err except ( - ClientConnectorError, - asyncio.TimeoutError, ReolinkException, ReolinkError, ) as err: diff --git a/homeassistant/components/reolink/host.py b/homeassistant/components/reolink/host.py index c57f7b1e77e..2e61c131490 100644 --- a/homeassistant/components/reolink/host.py +++ b/homeassistant/components/reolink/host.py @@ -222,11 +222,7 @@ class ReolinkHost: """Disconnect from the API, so the connection will be released.""" try: await self._api.unsubscribe() - except ( - aiohttp.ClientConnectorError, - asyncio.TimeoutError, - ReolinkError, - ) as err: + except ReolinkError as err: _LOGGER.error( "Reolink error while unsubscribing from host %s:%s: %s", self._api.host, @@ -236,11 +232,7 @@ class ReolinkHost: try: await self._api.logout() - except ( - aiohttp.ClientConnectorError, - asyncio.TimeoutError, - ReolinkError, - ) as err: + except ReolinkError as err: _LOGGER.error( "Reolink error while logging out for host %s:%s: %s", self._api.host, @@ -396,22 +388,13 @@ class ReolinkHost: try: await self._api.get_motion_state_all_ch() - except ( - aiohttp.ClientConnectorError, - ReolinkError, - ) as err: + except ReolinkError as err: _LOGGER.error( "Reolink error while polling motion state for host %s:%s: %s", self._api.host, self._api.port, str(err), ) - except asyncio.TimeoutError: - _LOGGER.error( - "Reolink timeout error while polling motion state for host %s:%s", - self._api.host, - self._api.port, - ) finally: # schedule next poll if not self._hass.is_stopping: diff --git a/homeassistant/components/reolink/manifest.json b/homeassistant/components/reolink/manifest.json index 413c106b53e..46aee506f9c 100644 --- a/homeassistant/components/reolink/manifest.json +++ b/homeassistant/components/reolink/manifest.json @@ -18,5 +18,5 @@ "documentation": "https://www.home-assistant.io/integrations/reolink", "iot_class": "local_push", "loggers": ["reolink_aio"], - "requirements": ["reolink-aio==0.5.16"] + "requirements": ["reolink-aio==0.6.0"] } diff --git a/homeassistant/components/reolink/update.py b/homeassistant/components/reolink/update.py index aeb44cb7740..54a42f9b1c7 100644 --- a/homeassistant/components/reolink/update.py +++ b/homeassistant/components/reolink/update.py @@ -30,8 +30,7 @@ async def async_setup_entry( ) -> None: """Set up update entities for Reolink component.""" reolink_data: ReolinkData = hass.data[DOMAIN][config_entry.entry_id] - if reolink_data.host.api.supported(None, "update"): - async_add_entities([ReolinkUpdateEntity(reolink_data)]) + async_add_entities([ReolinkUpdateEntity(reolink_data)]) class ReolinkUpdateEntity( @@ -64,7 +63,10 @@ class ReolinkUpdateEntity( if not self.coordinator.data: return self.installed_version - return self.coordinator.data + if isinstance(self.coordinator.data, str): + return self.coordinator.data + + return self.coordinator.data.version_string async def async_install( self, version: str | None, backup: bool, **kwargs: Any diff --git a/requirements_all.txt b/requirements_all.txt index 33753515e41..ce7bce75f11 100644 --- a/requirements_all.txt +++ b/requirements_all.txt @@ -2265,7 +2265,7 @@ regenmaschine==2023.05.1 renault-api==0.1.13 # homeassistant.components.reolink -reolink-aio==0.5.16 +reolink-aio==0.6.0 # homeassistant.components.idteck_prox rfk101py==0.0.1 diff --git a/requirements_test_all.txt b/requirements_test_all.txt index 58144fb0b63..c3faf412388 100644 --- a/requirements_test_all.txt +++ b/requirements_test_all.txt @@ -1652,7 +1652,7 @@ regenmaschine==2023.05.1 renault-api==0.1.13 # homeassistant.components.reolink -reolink-aio==0.5.16 +reolink-aio==0.6.0 # homeassistant.components.rflink rflink==0.0.65