Improve device shutdown and unload of Synology DSM integration (#65936)
* ignore errors during unload/logout * automatic host update is an info, nut debug
This commit is contained in:
parent
62da194340
commit
275d4b9770
2 changed files with 7 additions and 2 deletions
|
@ -16,6 +16,7 @@ from synology_dsm.api.storage.storage import SynoStorage
|
|||
from synology_dsm.api.surveillance_station import SynoSurveillanceStation
|
||||
from synology_dsm.exceptions import (
|
||||
SynologyDSMAPIErrorException,
|
||||
SynologyDSMException,
|
||||
SynologyDSMLoginFailedException,
|
||||
SynologyDSMRequestException,
|
||||
)
|
||||
|
@ -237,7 +238,11 @@ class SynoApi:
|
|||
|
||||
async def async_unload(self) -> None:
|
||||
"""Stop interacting with the NAS and prepare for removal from hass."""
|
||||
await self._syno_api_executer(self.dsm.logout)
|
||||
try:
|
||||
await self._syno_api_executer(self.dsm.logout)
|
||||
except SynologyDSMException:
|
||||
# ignore API errors during logout
|
||||
pass
|
||||
|
||||
async def async_update(self, now: timedelta | None = None) -> None:
|
||||
"""Update function for updating API information."""
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue