Synology sensor quick return if attr is null (#21709)
* Quick return if attr is null There are some case where attr is null. Returning null doesn't change anything (in my case this is mapped to a volume that doesn't exist, not sure what others are seeing). If you have confirmed you hass instance for C instead of F you do not see this error. * update == to is * whitespacepull/21877/head
parent
0f189809a9
commit
d8ac761bb6
homeassistant/components/sensor
|
@ -230,6 +230,9 @@ class SynoNasStorageSensor(SynoNasSensor):
|
|||
attr = getattr(
|
||||
self._api.storage, self.var_id)(self.monitor_device)
|
||||
|
||||
if attr is None:
|
||||
return None
|
||||
|
||||
if self._api.temp_unit == TEMP_CELSIUS:
|
||||
return attr
|
||||
|
||||
|
|
Loading…
Reference in New Issue