Skip to content

Commit

Permalink
Bump reolink-aio to 0.5.1 and check if update supported (home-assista…
Browse files Browse the repository at this point in the history
  • Loading branch information
starkillerOG authored and balloob committed Feb 23, 2023
1 parent cfaba87 commit 35142e4
Show file tree
Hide file tree
Showing 5 changed files with 8 additions and 4 deletions.
3 changes: 3 additions & 0 deletions homeassistant/components/reolink/__init__.py
Original file line number Diff line number Diff line change
Expand Up @@ -79,6 +79,9 @@ async def async_device_config_update():

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()
Expand Down
2 changes: 1 addition & 1 deletion homeassistant/components/reolink/manifest.json
Original file line number Diff line number Diff line change
Expand Up @@ -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"]
}
3 changes: 2 additions & 1 deletion homeassistant/components/reolink/update.py
Original file line number Diff line number Diff line change
Expand Up @@ -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):
Expand Down
2 changes: 1 addition & 1 deletion requirements_all.txt
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand Down
2 changes: 1 addition & 1 deletion requirements_test_all.txt
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand Down

0 comments on commit 35142e4

Please sign in to comment.