mirror of
https://github.com/home-assistant/core.git
synced 2025-07-17 02:07:09 +00:00
Bump reolink-aio to 0.6.0 (#94259)
This commit is contained in:
parent
fc1eab1e7e
commit
117ab4a0e5
@ -8,7 +8,6 @@ from datetime import timedelta
|
|||||||
import logging
|
import logging
|
||||||
from typing import Literal
|
from typing import Literal
|
||||||
|
|
||||||
from aiohttp import ClientConnectorError
|
|
||||||
import async_timeout
|
import async_timeout
|
||||||
from reolink_aio.exceptions import CredentialsInvalidError, ReolinkError
|
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()
|
await host.stop()
|
||||||
raise ConfigEntryAuthFailed(err) from err
|
raise ConfigEntryAuthFailed(err) from err
|
||||||
except (
|
except (
|
||||||
ClientConnectorError,
|
|
||||||
asyncio.TimeoutError,
|
|
||||||
ReolinkException,
|
ReolinkException,
|
||||||
ReolinkError,
|
ReolinkError,
|
||||||
) as err:
|
) as err:
|
||||||
|
@ -222,11 +222,7 @@ class ReolinkHost:
|
|||||||
"""Disconnect from the API, so the connection will be released."""
|
"""Disconnect from the API, so the connection will be released."""
|
||||||
try:
|
try:
|
||||||
await self._api.unsubscribe()
|
await self._api.unsubscribe()
|
||||||
except (
|
except ReolinkError as err:
|
||||||
aiohttp.ClientConnectorError,
|
|
||||||
asyncio.TimeoutError,
|
|
||||||
ReolinkError,
|
|
||||||
) as err:
|
|
||||||
_LOGGER.error(
|
_LOGGER.error(
|
||||||
"Reolink error while unsubscribing from host %s:%s: %s",
|
"Reolink error while unsubscribing from host %s:%s: %s",
|
||||||
self._api.host,
|
self._api.host,
|
||||||
@ -236,11 +232,7 @@ class ReolinkHost:
|
|||||||
|
|
||||||
try:
|
try:
|
||||||
await self._api.logout()
|
await self._api.logout()
|
||||||
except (
|
except ReolinkError as err:
|
||||||
aiohttp.ClientConnectorError,
|
|
||||||
asyncio.TimeoutError,
|
|
||||||
ReolinkError,
|
|
||||||
) as err:
|
|
||||||
_LOGGER.error(
|
_LOGGER.error(
|
||||||
"Reolink error while logging out for host %s:%s: %s",
|
"Reolink error while logging out for host %s:%s: %s",
|
||||||
self._api.host,
|
self._api.host,
|
||||||
@ -396,22 +388,13 @@ class ReolinkHost:
|
|||||||
|
|
||||||
try:
|
try:
|
||||||
await self._api.get_motion_state_all_ch()
|
await self._api.get_motion_state_all_ch()
|
||||||
except (
|
except ReolinkError as err:
|
||||||
aiohttp.ClientConnectorError,
|
|
||||||
ReolinkError,
|
|
||||||
) as err:
|
|
||||||
_LOGGER.error(
|
_LOGGER.error(
|
||||||
"Reolink error while polling motion state for host %s:%s: %s",
|
"Reolink error while polling motion state for host %s:%s: %s",
|
||||||
self._api.host,
|
self._api.host,
|
||||||
self._api.port,
|
self._api.port,
|
||||||
str(err),
|
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:
|
finally:
|
||||||
# schedule next poll
|
# schedule next poll
|
||||||
if not self._hass.is_stopping:
|
if not self._hass.is_stopping:
|
||||||
|
@ -18,5 +18,5 @@
|
|||||||
"documentation": "https://www.home-assistant.io/integrations/reolink",
|
"documentation": "https://www.home-assistant.io/integrations/reolink",
|
||||||
"iot_class": "local_push",
|
"iot_class": "local_push",
|
||||||
"loggers": ["reolink_aio"],
|
"loggers": ["reolink_aio"],
|
||||||
"requirements": ["reolink-aio==0.5.16"]
|
"requirements": ["reolink-aio==0.6.0"]
|
||||||
}
|
}
|
||||||
|
@ -30,8 +30,7 @@ async def async_setup_entry(
|
|||||||
) -> None:
|
) -> None:
|
||||||
"""Set up update entities for Reolink component."""
|
"""Set up update entities for Reolink component."""
|
||||||
reolink_data: ReolinkData = hass.data[DOMAIN][config_entry.entry_id]
|
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(
|
class ReolinkUpdateEntity(
|
||||||
@ -64,7 +63,10 @@ class ReolinkUpdateEntity(
|
|||||||
if not self.coordinator.data:
|
if not self.coordinator.data:
|
||||||
return self.installed_version
|
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(
|
async def async_install(
|
||||||
self, version: str | None, backup: bool, **kwargs: Any
|
self, version: str | None, backup: bool, **kwargs: Any
|
||||||
|
@ -2265,7 +2265,7 @@ regenmaschine==2023.05.1
|
|||||||
renault-api==0.1.13
|
renault-api==0.1.13
|
||||||
|
|
||||||
# homeassistant.components.reolink
|
# homeassistant.components.reolink
|
||||||
reolink-aio==0.5.16
|
reolink-aio==0.6.0
|
||||||
|
|
||||||
# homeassistant.components.idteck_prox
|
# homeassistant.components.idteck_prox
|
||||||
rfk101py==0.0.1
|
rfk101py==0.0.1
|
||||||
|
@ -1652,7 +1652,7 @@ regenmaschine==2023.05.1
|
|||||||
renault-api==0.1.13
|
renault-api==0.1.13
|
||||||
|
|
||||||
# homeassistant.components.reolink
|
# homeassistant.components.reolink
|
||||||
reolink-aio==0.5.16
|
reolink-aio==0.6.0
|
||||||
|
|
||||||
# homeassistant.components.rflink
|
# homeassistant.components.rflink
|
||||||
rflink==0.0.65
|
rflink==0.0.65
|
||||||
|
Loading…
x
Reference in New Issue
Block a user