Update docstrings (#6795)
* Add link to docs and remove comments which are obvious * Update docstrings * Repleace conf details with link to docs * Add link to docs * Update docstrings * Update import * Update ordering * Update ordering * Update docstring * Update ordering * Update ordering
This commit is contained in:
1 parent
22b28d85db
commit
5d5547cdb6
14 files changed
+160
-192
No files matched your search
@@ -1,4 +1,9 @@
|
||||
"""Entity to track connections to stream API."""
|
||||
"""
|
||||
Entity to track connections to stream API.
|
||||
|
||||
For more details about this platform, please refer to the documentation at
|
||||
https://home-assistant.io/components/sensor.api_stream/
|
||||
"""
|
||||
import asyncio
|
||||
import logging
|
||||
|
||||
@@ -6,7 +11,6 @@ from homeassistant.const import EVENT_HOMEASSISTANT_STOP
|
||||
from homeassistant.core import callback
|
||||
from homeassistant.helpers.entity import Entity
|
||||
|
||||
|
||||
NAME_WS = 'homeassistant.components.websocket_api'
|
||||
NAME_STREAM = 'homeassistant.components.api'
|
||||
|
||||
@@ -46,7 +50,7 @@ class StreamHandler(logging.Handler):
|
||||
|
||||
@asyncio.coroutine
|
||||
def async_setup_platform(hass, config, async_add_devices, discovery_info=None):
|
||||
"""Set up the logger for filters."""
|
||||
"""Set up the API stream platform."""
|
||||
entity = APICount()
|
||||
handler = StreamHandler(entity)
|
||||
|
||||
|
||||
@@ -10,18 +10,19 @@ from homeassistant.components.blink import DOMAIN
|
||||
from homeassistant.const import TEMP_FAHRENHEIT
|
||||
from homeassistant.helpers.entity import Entity
|
||||
|
||||
_LOGGER = logging.getLogger(__name__)
|
||||
|
||||
DEPENDENCIES = ['blink']
|
||||
|
||||
SENSOR_TYPES = {
|
||||
'temperature': ['Temperature', TEMP_FAHRENHEIT],
|
||||
'battery': ['Battery', ''],
|
||||
'notifications': ['Notifications', '']
|
||||
}
|
||||
|
||||
_LOGGER = logging.getLogger(__name__)
|
||||
|
||||
|
||||
def setup_platform(hass, config, add_devices, discovery_info=None):
|
||||
"""Setup a Blink sensor."""
|
||||
"""Set up a Blink sensor."""
|
||||
if discovery_info is None:
|
||||
return
|
||||
|
||||
|
||||
@@ -8,15 +8,15 @@ import logging
|
||||
from datetime import timedelta
|
||||
|
||||
import voluptuous as vol
|
||||
import homeassistant.helpers.config_validation as cv
|
||||
|
||||
import homeassistant.loader as loader
|
||||
import homeassistant.helpers.config_validation as cv
|
||||
from homeassistant.components.sensor import PLATFORM_SCHEMA
|
||||
from homeassistant.const import (
|
||||
CONF_ENTITY_NAMESPACE, CONF_MONITORED_CONDITIONS, CONF_SCAN_INTERVAL,
|
||||
CONF_USERNAME, CONF_PASSWORD, STATE_UNKNOWN,
|
||||
ATTR_ATTRIBUTION)
|
||||
from homeassistant.helpers.entity import Entity
|
||||
import homeassistant.loader as loader
|
||||
|
||||
from requests.exceptions import HTTPError, ConnectTimeout
|
||||
|
||||
|
||||
Reference in new issue
Block a user