mirror of
https://github.com/home-assistant/core.git
synced 2025-07-19 11:17:21 +00:00
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 * whitespace
This commit is contained in:
parent
0f189809a9
commit
d8ac761bb6
@ -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…
x
Reference in New Issue
Block a user