Bump reolink-aio to 0.6.0 (#94259)

This commit is contained in:
starkillerOG 2023-06-09 17:00:07 +02:00 committed by GitHub
parent fc1eab1e7e
commit 117ab4a0e5
No known key found for this signature in database
GPG key ID: 4AEE18F83AFDEB23
6 changed files with 11 additions and 29 deletions

View file

@ -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:

View file

@ -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:

View file

@ -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"]
}

View file

@ -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

View file

@ -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

View file

@ -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