Update docstring (config file) and attempt to honor PEP0257

This commit is contained in:
Fabian Affolter 2015-09-07 18:38:49 +02:00
parent 1d910f3a84
commit e196c136c1

View file

@ -1,4 +1,6 @@
"""
homeassistant.components.camera.generic
~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
Support for IP Cameras.
This component provides basic support for IP cameras. For the basic support to
@ -7,11 +9,11 @@ need to specify the "still_image_url" parameter which should be the location of
the JPEG image.
As part of the basic support the following features will be provided:
-MJPEG video streaming
-Saving a snapshot
-Recording(JPEG frame capture)
- MJPEG video streaming
- Saving a snapshot
- Recording(JPEG frame capture)
To use this component, add the following to your config/configuration.yaml:
To use this component, add the following to your configuration.yaml file.
camera:
platform: generic
@ -20,29 +22,24 @@ camera:
password: YOUR_PASSWORD
still_image_url: http://YOUR_CAMERA_IP_AND_PORT/image.jpg
VARIABLES:
These are the variables for the device_data array:
Variables:
still_image_url
*Required
The URL your camera serves the image on.
Example: http://192.168.1.21:2112/
The URL your camera serves the image on, eg. http://192.168.1.21:2112/
name
*Optional
This parameter allows you to override the name of your camera in homeassistant
This parameter allows you to override the name of your camera in Home
Assistant.
username
*Optional
THe username for acessing your camera
The username for accessing your camera.
password
*Optional
the password for accessing your camera
The password for accessing your camera.
"""
import logging
from requests.auth import HTTPBasicAuth
@ -78,7 +75,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 reponse from the camera. """
if self._username and self._password:
response = requests.get(
self._still_image_url,
@ -90,5 +87,5 @@ class GenericCamera(Camera):
@property
def name(self):
""" Return the name of this device """
""" Return the name of this device. """
return self._name