Update docstrings (#7361)

* Update docstrings

* Update docstrings

* Update docstrings

* Update docstrings

* update docstrings

* Update docstrings

* Update docstrings

* Update docstrings

* Update docstrings

* Update docstrings

* Update tomato.py

* Update isy994.py

* Lint + fix tests

* Lint
This commit is contained in:
Fabian Affolter authored and Paulus Schoutsen committed 2017-04-29 22:04:49 -07:00
1 parent e22e70a01a
commit 3ee4d1060f
264 files changed
+1686 -1768

No files matched your search

+15 -14
View File
@@ -1,5 +1,5 @@
"""
Component that will help set the ffmpeg component.
Component that will help set the FFmpeg component.
For more details about this component, please refer to the documentation at
https://home-assistant.io/components/ffmpeg/
@@ -19,8 +19,9 @@ from homeassistant.helpers.dispatcher import (
import homeassistant.helpers.config_validation as cv
from homeassistant.helpers.entity import Entity
REQUIREMENTS = ['ha-ffmpeg==1.5']
DOMAIN = 'ffmpeg'
REQUIREMENTS = ["ha-ffmpeg==1.5"]
_LOGGER = logging.getLogger(__name__)
@@ -58,28 +59,28 @@ SERVICE_FFMPEG_SCHEMA = vol.Schema({
@callback
def async_start(hass, entity_id=None):
"""Start a ffmpeg process on entity."""
"""Start a FFmpeg process on entity."""
data = {ATTR_ENTITY_ID: entity_id} if entity_id else {}
hass.async_add_job(hass.services.async_call(DOMAIN, SERVICE_START, data))
@callback
def async_stop(hass, entity_id=None):
"""Stop a ffmpeg process on entity."""
"""Stop a FFmpeg process on entity."""
data = {ATTR_ENTITY_ID: entity_id} if entity_id else {}
hass.async_add_job(hass.services.async_call(DOMAIN, SERVICE_STOP, data))
@callback
def async_restart(hass, entity_id=None):
"""Restart a ffmpeg process on entity."""
"""Restart a FFmpeg process on entity."""
data = {ATTR_ENTITY_ID: entity_id} if entity_id else {}
hass.async_add_job(hass.services.async_call(DOMAIN, SERVICE_RESTART, data))
@asyncio.coroutine
def async_setup(hass, config):
"""Setup the FFmpeg component."""
"""Set up the FFmpeg component."""
conf = config.get(DOMAIN, {})
manager = FFmpegManager(
@@ -92,7 +93,7 @@ def async_setup(hass, config):
None, load_yaml_config_file,
os.path.join(os.path.dirname(__file__), 'services.yaml'))
# register service
# Register service
@asyncio.coroutine
def async_service_handle(service):
"""Handle service ffmpeg process."""
@@ -162,7 +163,7 @@ class FFmpegManager(object):
class FFmpegBase(Entity):
"""Interface object for ffmpeg."""
"""Interface object for FFmpeg."""
def __init__(self, initial_state=True):
"""Initialize ffmpeg base object."""
@@ -197,7 +198,7 @@ class FFmpegBase(Entity):
@asyncio.coroutine
def _async_start_ffmpeg(self, entity_ids):
"""Start a ffmpeg process.
"""Start a FFmpeg process.
This method is a coroutine.
"""
@@ -205,7 +206,7 @@ class FFmpegBase(Entity):
@asyncio.coroutine
def _async_stop_ffmpeg(self, entity_ids):
"""Stop a ffmpeg process.
"""Stop a FFmpeg process.
This method is a coroutine.
"""
@@ -214,7 +215,7 @@ class FFmpegBase(Entity):
@asyncio.coroutine
def _async_restart_ffmpeg(self, entity_ids):
"""Stop a ffmpeg process.
"""Stop a FFmpeg process.
This method is a coroutine.
"""
@@ -224,10 +225,10 @@ class FFmpegBase(Entity):
@callback
def _async_register_events(self):
"""Register a ffmpeg process/device."""
"""Register a FFmpeg process/device."""
@asyncio.coroutine
def async_shutdown_handle(event):
"""Stop ffmpeg process."""
"""Stop FFmpeg process."""
yield from self._async_stop_ffmpeg(None)
self.hass.bus.async_listen_once(
@@ -239,7 +240,7 @@ class FFmpegBase(Entity):
@asyncio.coroutine
def async_start_handle(event):
"""Start ffmpeg process."""
"""Start FFmpeg process."""
yield from self._async_start_ffmpeg(None)
self.hass.async_add_job(self.async_update_ha_state())