Pylint cleanups (#15626)
* Pylint 2 no-else-return fixes * Remove unneeded abstract-class-not-used pylint disable
This commit is contained in:
1 parent
a38c0d6d15
commit
b7c336a687
166 files changed
+425
-490
No files matched your search
@@ -236,13 +236,12 @@ class NUTSensor(Entity):
|
||||
"""Return UPS display state."""
|
||||
if self._data.status is None:
|
||||
return STATE_TYPES['OFF']
|
||||
else:
|
||||
try:
|
||||
return " ".join(
|
||||
STATE_TYPES[state]
|
||||
for state in self._data.status[KEY_STATUS].split())
|
||||
except KeyError:
|
||||
return STATE_UNKNOWN
|
||||
try:
|
||||
return " ".join(
|
||||
STATE_TYPES[state]
|
||||
for state in self._data.status[KEY_STATUS].split())
|
||||
except KeyError:
|
||||
return STATE_UNKNOWN
|
||||
|
||||
def update(self):
|
||||
"""Get the latest status and use it to update our sensor state."""
|
||||
|
||||
Reference in new issue
Block a user