Bump reolink-aio to 0.5.1 and check if update supported (#88641)

This commit is contained in:
starkillerOG 2023-02-23 08:13:03 +01:00 committed by GitHub
parent 87dc692a20
commit 23b52025f9
No known key found for this signature in database
GPG key ID: 4AEE18F83AFDEB23
5 changed files with 8 additions and 4 deletions

View file

@ -79,6 +79,9 @@ async def async_setup_entry(hass: HomeAssistant, config_entry: ConfigEntry) -> b
async def async_check_firmware_update():
"""Check for firmware updates."""
if not host.api.supported(None, "update"):
return False
async with async_timeout.timeout(host.api.timeout):
try:
return await host.api.check_new_firmware()

View file

@ -13,5 +13,5 @@
"documentation": "https://www.home-assistant.io/integrations/reolink",
"iot_class": "local_push",
"loggers": ["reolink_aio"],
"requirements": ["reolink-aio==0.5.0"]
"requirements": ["reolink-aio==0.5.1"]
}

View file

@ -30,7 +30,8 @@ async def async_setup_entry(
) -> None:
"""Set up update entities for Reolink component."""
reolink_data: ReolinkData = hass.data[DOMAIN][config_entry.entry_id]
async_add_entities([ReolinkUpdateEntity(reolink_data)])
if reolink_data.host.api.supported(None, "update"):
async_add_entities([ReolinkUpdateEntity(reolink_data)])
class ReolinkUpdateEntity(ReolinkBaseCoordinatorEntity, UpdateEntity):

View file

@ -2237,7 +2237,7 @@ regenmaschine==2022.11.0
renault-api==0.1.12
# homeassistant.components.reolink
reolink-aio==0.5.0
reolink-aio==0.5.1
# homeassistant.components.python_script
restrictedpython==6.0

View file

@ -1585,7 +1585,7 @@ regenmaschine==2022.11.0
renault-api==0.1.12
# homeassistant.components.reolink
reolink-aio==0.5.0
reolink-aio==0.5.1
# homeassistant.components.python_script
restrictedpython==6.0