Fix SynologyDSM sensor if network_sensors is None (#30718)

pull/30727/head
Quentame 2020-01-13 04:42:37 +01:00 committed by Martin Hjelmare
parent 0534153ae7
commit 123bef4f1e
1 changed files with 3 additions and 0 deletions

View File

@ -231,6 +231,9 @@ class SynoNasUtilSensor(SynoNasSensor):
if self.var_id in network_sensors or self.var_id in memory_sensors:
attr = getattr(self._api.utilisation, self.var_id)(False)
if attr is None:
return None
if self.var_id in network_sensors:
return round(attr / 1024.0, 1)
if self.var_id in memory_sensors: