Set Synology DSM update entity to unavailable in case no data from api gathered (#79508)

This commit is contained in:
Michael
2022-10-03 03:19:37 +02:00
committed by GitHub
parent d6a6d0d754
commit d7be3c8780

View File

@@ -52,6 +52,11 @@ class SynoDSMUpdateEntity(SynologyDSMBaseEntity, UpdateEntity):
entity_description: SynologyDSMUpdateEntityEntityDescription
_attr_title = "Synology DSM"
@property
def available(self) -> bool:
"""Return True if entity is available."""
return bool(self._api.upgrade)
@property
def installed_version(self) -> str | None:
"""Version installed and in use."""