1
mirror of https://github.com/home-assistant/core synced 2024-09-06 10:29:55 +02:00

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 GitHub
parent 953228ebd2
commit 94b6130af6
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23

View File

@ -156,7 +156,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)
@ -177,7 +177,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)