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

This commit is contained in:
Quentame 2020-05-04 23:19:08 +02:00 committed by Paulus Schoutsen
parent 96576a9775
commit 222a8bb7be

View File

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