Skip to content

Commit

Permalink
Reolink fix not unregistering webhook during ReAuth (#117490)
Browse files Browse the repository at this point in the history
  • Loading branch information
starkillerOG authored and frenck committed May 17, 2024
1 parent b86513c commit 615ae78
Show file tree
Hide file tree
Showing 2 changed files with 7 additions and 1 deletion.
1 change: 1 addition & 0 deletions homeassistant/components/reolink/__init__.py
Original file line number Diff line number Diff line change
Expand Up @@ -85,6 +85,7 @@ async def async_device_config_update() -> None:
try:
await host.update_states()
except CredentialsInvalidError as err:
await host.stop()
raise ConfigEntryAuthFailed(err) from err
except ReolinkError as err:
raise UpdateFailed(str(err)) from err
Expand Down
7 changes: 6 additions & 1 deletion tests/components/reolink/test_init.py
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,7 @@
from unittest.mock import AsyncMock, MagicMock, Mock, patch

import pytest
from reolink_aio.exceptions import ReolinkError
from reolink_aio.exceptions import CredentialsInvalidError, ReolinkError

from homeassistant.components.reolink import FIRMWARE_UPDATE_INTERVAL, const
from homeassistant.config import async_process_ha_core_config
Expand Down Expand Up @@ -50,6 +50,11 @@
AsyncMock(side_effect=ReolinkError("Test error")),
ConfigEntryState.SETUP_RETRY,
),
(
"get_states",
AsyncMock(side_effect=CredentialsInvalidError("Test error")),
ConfigEntryState.SETUP_ERROR,
),
(
"supported",
Mock(return_value=False),
Expand Down

0 comments on commit 615ae78

Please sign in to comment.