Handle UPS disconnects in NUT (#35758)
This commit is contained in:
1 parent
99afc17b3f
commit
7417b3be66
2 files changed
+6
-2
No files matched your search
@@ -189,6 +189,8 @@ class NUTSensor(Entity):
|
||||
@property
|
||||
def state(self):
|
||||
"""Return entity state from ups."""
|
||||
if not self._data.status:
|
||||
return None
|
||||
if self._type == KEY_STATUS_DISPLAY:
|
||||
return _format_display_state(self._data.status)
|
||||
return self._data.status.get(self._type)
|
||||
|
||||
Reference in new issue
Block a user