Update docstrings

This commit is contained in:
Fabian Affolter 2015-11-18 08:42:49 +01:00
parent 8be53af78f
commit ab9e173179
2 changed files with 9 additions and 8 deletions

View File

@ -58,7 +58,7 @@ MJPEG_START_HEADER = 'Content-type: {0}\r\n\r\n'
# pylint: disable=too-many-branches
def setup(hass, config):
""" Track states and offer events for sensors. """
""" Track states and offer events for cameras. """
component = EntityComponent(
logging.getLogger(__name__), DOMAIN, hass, SCAN_INTERVAL,
@ -101,7 +101,8 @@ def setup(hass, config):
# pylint: disable=unused-argument
def _proxy_camera_mjpeg_stream(handler, path_match, data):
""" Proxies the camera image as an mjpeg stream via the HA server.
"""
Proxies the camera image as an mjpeg stream via the HA server.
This function takes still images from the IP camera and turns them
into an MJPEG stream. This means that HA can return a live video
stream even with only a still image URL available.
@ -163,7 +164,7 @@ def setup(hass, config):
class Camera(Entity):
""" The base class for camera components """
""" The base class for camera components. """
def __init__(self):
self.is_streaming = False
@ -171,23 +172,23 @@ class Camera(Entity):
@property
# pylint: disable=no-self-use
def is_recording(self):
""" Returns true if the device is recording """
""" Returns true if the device is recording. """
return False
@property
# pylint: disable=no-self-use
def brand(self):
""" Should return a string of the camera brand """
""" Should return a string of the camera brand. """
return None
@property
# pylint: disable=no-self-use
def model(self):
""" Returns string of camera model """
""" Returns string of camera model. """
return None
def camera_image(self):
""" Return bytes of camera image """
""" Return bytes of camera image. """
raise NotImplementedError()
@property

View File

@ -40,7 +40,7 @@ class GenericCamera(Camera):
self._still_image_url = device_info['still_image_url']
def camera_image(self):
""" Return a still image reponse from the camera. """
""" Return a still image response from the camera. """
if self._username and self._password:
try:
response = requests.get(