Fix synology_dsm availablity (#115073)
* Remove reload on update failure from synology_dsm fixes #115062 The coordinator will retry on its own later, there is no reason to reload here. This was added in #42697 * fix available checkspull/107862/head
parent
b456a212eb
commit
f2fe2c4510
|
@ -116,7 +116,7 @@ class SynoDSMSecurityBinarySensor(SynoDSMBinarySensor):
|
|||
@property
|
||||
def available(self) -> bool:
|
||||
"""Return True if entity is available."""
|
||||
return bool(self._api.security)
|
||||
return bool(self._api.security) and super().available
|
||||
|
||||
@property
|
||||
def extra_state_attributes(self) -> dict[str, str]:
|
||||
|
|
|
@ -108,7 +108,7 @@ class SynoDSMCamera(SynologyDSMBaseEntity[SynologyDSMCameraUpdateCoordinator], C
|
|||
@property
|
||||
def available(self) -> bool:
|
||||
"""Return the availability of the camera."""
|
||||
return self.camera_data.is_enabled and self.coordinator.last_update_success
|
||||
return self.camera_data.is_enabled and super().available
|
||||
|
||||
@property
|
||||
def is_recording(self) -> bool:
|
||||
|
|
|
@ -286,18 +286,7 @@ class SynoApi:
|
|||
|
||||
async def async_update(self) -> None:
|
||||
"""Update function for updating API information."""
|
||||
try:
|
||||
await self._update()
|
||||
except SYNOLOGY_CONNECTION_EXCEPTIONS as err:
|
||||
LOGGER.debug(
|
||||
"Connection error during update of '%s' with exception: %s",
|
||||
self._entry.unique_id,
|
||||
err,
|
||||
)
|
||||
LOGGER.warning(
|
||||
"Connection error during update, fallback by reloading the entry"
|
||||
)
|
||||
await self._hass.config_entries.async_reload(self._entry.entry_id)
|
||||
await self._update()
|
||||
|
||||
async def _update(self) -> None:
|
||||
"""Update function for updating API information."""
|
||||
|
|
|
@ -367,7 +367,7 @@ class SynoDSMUtilSensor(SynoDSMSensor):
|
|||
@property
|
||||
def available(self) -> bool:
|
||||
"""Return True if entity is available."""
|
||||
return bool(self._api.utilisation)
|
||||
return bool(self._api.utilisation) and super().available
|
||||
|
||||
|
||||
class SynoDSMStorageSensor(SynologyDSMDeviceEntity, SynoDSMSensor):
|
||||
|
|
|
@ -98,7 +98,7 @@ class SynoDSMSurveillanceHomeModeToggle(
|
|||
@property
|
||||
def available(self) -> bool:
|
||||
"""Return True if entity is available."""
|
||||
return bool(self._api.surveillance_station)
|
||||
return bool(self._api.surveillance_station) and super().available
|
||||
|
||||
@property
|
||||
def device_info(self) -> DeviceInfo:
|
||||
|
|
|
@ -59,7 +59,7 @@ class SynoDSMUpdateEntity(
|
|||
@property
|
||||
def available(self) -> bool:
|
||||
"""Return True if entity is available."""
|
||||
return bool(self._api.upgrade)
|
||||
return bool(self._api.upgrade) and super().available
|
||||
|
||||
@property
|
||||
def installed_version(self) -> str | None:
|
||||
|
|
Loading…
Reference in New Issue