Fix Synology DSM sensor to be False or 0 (#35208)
parent
953228ebd2
commit
94b6130af6
|
@ -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)
|
||||||
|
|
Loading…
Reference in New Issue