Fix Synology DSM sensor to be False or 0 (#35208)

pull/35217/head
Quentame 2020-05-04 23:19:08 +02:00 committed by GitHub
parent 953228ebd2
commit 94b6130af6
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
1 changed files with 2 additions and 2 deletions

View File

@ -156,7 +156,7 @@ class SynoNasUtilSensor(SynoNasSensor):
attr = getattr(self._api.utilisation, self.sensor_type) attr = getattr(self._api.utilisation, self.sensor_type)
if callable(attr): if callable(attr):
attr = attr() attr = attr()
if not attr: if attr is None:
return None return None
# Data (RAM) # Data (RAM)
@ -177,7 +177,7 @@ class SynoNasStorageSensor(SynoNasSensor):
def state(self): def state(self):
"""Return the state.""" """Return the state."""
attr = getattr(self._api.storage, self.sensor_type)(self.monitored_device) attr = getattr(self._api.storage, self.sensor_type)(self.monitored_device)
if not attr: if attr is None:
return None return None
# Data (disk space) # Data (disk space)