mirror of
https://github.com/home-assistant/core.git
synced 2025-07-27 15:17:35 +00:00
Fix SynologyDSM sensor if network_sensors is None (#30718)
This commit is contained in:
parent
0534153ae7
commit
123bef4f1e
@ -231,6 +231,9 @@ class SynoNasUtilSensor(SynoNasSensor):
|
|||||||
if self.var_id in network_sensors or self.var_id in memory_sensors:
|
if self.var_id in network_sensors or self.var_id in memory_sensors:
|
||||||
attr = getattr(self._api.utilisation, self.var_id)(False)
|
attr = getattr(self._api.utilisation, self.var_id)(False)
|
||||||
|
|
||||||
|
if attr is None:
|
||||||
|
return None
|
||||||
|
|
||||||
if self.var_id in network_sensors:
|
if self.var_id in network_sensors:
|
||||||
return round(attr / 1024.0, 1)
|
return round(attr / 1024.0, 1)
|
||||||
if self.var_id in memory_sensors:
|
if self.var_id in memory_sensors:
|
||||||
|
Loading…
x
Reference in New Issue
Block a user