Pylint cleanups (#15626)

* Pylint 2 no-else-return fixes

* Remove unneeded abstract-class-not-used pylint disable
This commit is contained in:
Ville Skyttä authored and Paulus Schoutsen committed 2018-07-23 10:16:05 +02:00
1 parent a38c0d6d15
commit b7c336a687
166 files changed
+425 -490

No files matched your search

+1 -1
View File
@@ -342,7 +342,7 @@ class Camera(Entity):
"""Return the camera state."""
if self.is_recording:
return STATE_RECORDING
elif self.is_streaming:
if self.is_streaming:
return STATE_STREAMING
return STATE_IDLE
+1 -1
View File
@@ -64,7 +64,7 @@ class AmcrestCam(Camera):
yield from super().handle_async_mjpeg_stream(request)
return
elif self._stream_source == STREAM_SOURCE_LIST['mjpeg']:
if self._stream_source == STREAM_SOURCE_LIST['mjpeg']:
# stream an MJPEG image stream directly from the camera
websession = async_get_clientsession(self.hass)
streaming_url = self._camera.mjpeg_url(typeno=self._resolution)
+1 -1
View File
@@ -23,7 +23,7 @@ def _get_image_url(host, port, mode):
"""Set the URL to get the image."""
if mode == 'mjpeg':
return 'http://{}:{}/axis-cgi/mjpg/video.cgi'.format(host, port)
elif mode == 'single':
if mode == 'single':
return 'http://{}:{}/axis-cgi/jpg/image.cgi'.format(host, port)
+1 -1
View File
@@ -105,6 +105,6 @@ class NetatmoCamera(Camera):
"""Return the camera model."""
if self._cameratype == "NOC":
return "Presence"
elif self._cameratype == "NACamera":
if self._cameratype == "NACamera":
return "Welcome"
return None
+3 -4
View File
@@ -171,10 +171,9 @@ class UnifiVideoCamera(Camera):
if retry:
self._login()
return _get_image(retry=False)
else:
_LOGGER.error(
"Unable to log into camera, unable to get snapshot")
raise
_LOGGER.error(
"Unable to log into camera, unable to get snapshot")
raise
return _get_image()