mirror of
https://github.com/home-assistant/core.git
synced 2025-07-20 03:37:07 +00:00
Update docstrings
This commit is contained in:
parent
8be53af78f
commit
ab9e173179
@ -58,7 +58,7 @@ MJPEG_START_HEADER = 'Content-type: {0}\r\n\r\n'
|
|||||||
|
|
||||||
# pylint: disable=too-many-branches
|
# pylint: disable=too-many-branches
|
||||||
def setup(hass, config):
|
def setup(hass, config):
|
||||||
""" Track states and offer events for sensors. """
|
""" Track states and offer events for cameras. """
|
||||||
|
|
||||||
component = EntityComponent(
|
component = EntityComponent(
|
||||||
logging.getLogger(__name__), DOMAIN, hass, SCAN_INTERVAL,
|
logging.getLogger(__name__), DOMAIN, hass, SCAN_INTERVAL,
|
||||||
@ -101,7 +101,8 @@ def setup(hass, config):
|
|||||||
|
|
||||||
# pylint: disable=unused-argument
|
# pylint: disable=unused-argument
|
||||||
def _proxy_camera_mjpeg_stream(handler, path_match, data):
|
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
|
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
|
into an MJPEG stream. This means that HA can return a live video
|
||||||
stream even with only a still image URL available.
|
stream even with only a still image URL available.
|
||||||
@ -163,7 +164,7 @@ def setup(hass, config):
|
|||||||
|
|
||||||
|
|
||||||
class Camera(Entity):
|
class Camera(Entity):
|
||||||
""" The base class for camera components """
|
""" The base class for camera components. """
|
||||||
|
|
||||||
def __init__(self):
|
def __init__(self):
|
||||||
self.is_streaming = False
|
self.is_streaming = False
|
||||||
@ -171,23 +172,23 @@ class Camera(Entity):
|
|||||||
@property
|
@property
|
||||||
# pylint: disable=no-self-use
|
# pylint: disable=no-self-use
|
||||||
def is_recording(self):
|
def is_recording(self):
|
||||||
""" Returns true if the device is recording """
|
""" Returns true if the device is recording. """
|
||||||
return False
|
return False
|
||||||
|
|
||||||
@property
|
@property
|
||||||
# pylint: disable=no-self-use
|
# pylint: disable=no-self-use
|
||||||
def brand(self):
|
def brand(self):
|
||||||
""" Should return a string of the camera brand """
|
""" Should return a string of the camera brand. """
|
||||||
return None
|
return None
|
||||||
|
|
||||||
@property
|
@property
|
||||||
# pylint: disable=no-self-use
|
# pylint: disable=no-self-use
|
||||||
def model(self):
|
def model(self):
|
||||||
""" Returns string of camera model """
|
""" Returns string of camera model. """
|
||||||
return None
|
return None
|
||||||
|
|
||||||
def camera_image(self):
|
def camera_image(self):
|
||||||
""" Return bytes of camera image """
|
""" Return bytes of camera image. """
|
||||||
raise NotImplementedError()
|
raise NotImplementedError()
|
||||||
|
|
||||||
@property
|
@property
|
||||||
|
@ -40,7 +40,7 @@ class GenericCamera(Camera):
|
|||||||
self._still_image_url = device_info['still_image_url']
|
self._still_image_url = device_info['still_image_url']
|
||||||
|
|
||||||
def camera_image(self):
|
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:
|
if self._username and self._password:
|
||||||
try:
|
try:
|
||||||
response = requests.get(
|
response = requests.get(
|
||||||
|
Loading…
x
Reference in New Issue
Block a user