Fix pylint 1.7.2 no-else-return issues (#8361)

* Fix pylint 1.7.2 no-else-return issues

* Update tomato.py
This commit is contained in:
Paulus Schoutsen authored and GitHub committed 2017-07-05 23:30:01 -07:00
1 parent 5779d64e98
commit 46e030662d
111 files changed
+305 -455

No files matched your search

+1 -4
View File
@@ -89,10 +89,7 @@ class NeatoConnectedSwitch(ToggleEntity):
@property
def available(self):
"""Return True if entity is available."""
if not self._state:
return False
else:
return True
return self._state
@property
def is_on(self):
+3 -3
View File
@@ -137,9 +137,9 @@ class RachioIro(object):
if include_disabled:
return self._zones
else:
self.update(no_throttle=True)
return [z for z in self._zones if z.is_enabled]
self.update(no_throttle=True)
return [z for z in self._zones if z.is_enabled]
@util.Throttle(MIN_UPDATE_INTERVAL, MIN_FORCED_UPDATE_INTERVAL)
def update(self, **kwargs):
+2 -4
View File
@@ -162,8 +162,7 @@ class WemoSwitch(SwitchDevice):
return STATE_OFF
elif standby_state == WEMO_STANDBY:
return STATE_STANDBY
else:
return STATE_UNKNOWN
return STATE_UNKNOWN
@property
def is_on(self):
@@ -186,8 +185,7 @@ class WemoSwitch(SwitchDevice):
"""Return the icon of device based on its type."""
if self._model_name == 'CoffeeMaker':
return 'mdi:coffee'
else:
return super().icon
return None
def turn_on(self, **kwargs):
"""Turn the switch on."""