Update docstrings (#7405)

* Update docstrings

* Fix lint issues

* Update docstrings
This commit is contained in:
Fabian Affolter authored and GitHub committed 2017-05-02 22:47:20 +02:00
1 parent 12c8266942
commit 4d52b0ecd5
81 files changed
+375 -409

No files matched your search

@@ -87,5 +87,5 @@ class APICount(Entity):
@property
def unit_of_measurement(self):
"""Unit of measurement."""
"""Return the unit of measurement."""
return "clients"
+1 -1
View File
@@ -42,7 +42,7 @@ class BlinkSensor(Entity):
"""A Blink camera sensor."""
def __init__(self, name, sensor_type, index, data):
"""A method to initialize sensors from Blink camera."""
"""Initialize sensors from Blink camera."""
self._name = 'blink_' + name + '_' + SENSOR_TYPES[sensor_type][0]
self._camera_name = name
self._type = sensor_type
+1 -1
View File
@@ -272,7 +272,7 @@ def closest_station(lat, lon, cache_dir):
stations = bom_stations(cache_dir)
def comparable_dist(wmo_id):
"""A fast key function for psudeo-distance from lat/lon."""
"""Create a psudeo-distance from lat/lon."""
station_lat, station_lon = stations[wmo_id]
return (lat - station_lat) ** 2 + (lon - station_lon) ** 2
@@ -118,7 +118,7 @@ class EddystoneTemp(Entity):
@property
def should_poll(self):
"""Hass should not poll for state."""
"""Return the polling state."""
return False
@@ -135,7 +135,7 @@ class Monitor(object):
self.bt_device_id = bt_device_id
def callback(bt_addr, _, packet, additional_info):
"""Callback for new packets."""
"""Handle new packets."""
self.process_packet(
additional_info['namespace'], additional_info['instance'],
packet.temperature)
@@ -157,10 +157,10 @@ class Monitor(object):
self.scanning = True
else:
_LOGGER.debug(
"Warning: start() called, but scanner is already running")
"start() called, but scanner is already running")
def process_packet(self, namespace, instance, temperature):
"""Assign temperature to hass device."""
"""Assign temperature to device."""
_LOGGER.debug("Received temperature for <%s,%s>: %d",
namespace, instance, temperature)
@@ -179,4 +179,4 @@ class Monitor(object):
self.scanning = False
else:
_LOGGER.debug(
"Warning: stop() called but scanner was not running")
"stop() called but scanner was not running")
@@ -38,7 +38,7 @@ _LOGGER = logging.getLogger(__name__)
@asyncio.coroutine
def async_setup_platform(hass, config, async_add_devices, discovery_info=None):
"""Setup the eight sleep sensors."""
"""Set up the eight sleep sensors."""
if discovery_info is None:
return
@@ -80,7 +80,7 @@ class EightHeatSensor(EightSleepHeatEntity):
self._userid = self._eight.fetch_userid(self._side)
self._usrobj = self._eight.users[self._userid]
_LOGGER.debug('Heat Sensor: %s, Side: %s, User: %s',
_LOGGER.debug("Heat Sensor: %s, Side: %s, User: %s",
self._sensor, self._side, self._userid)
@property
@@ -101,7 +101,7 @@ class EightHeatSensor(EightSleepHeatEntity):
@asyncio.coroutine
def async_update(self):
"""Retrieve latest state."""
_LOGGER.debug('Updating Heat sensor: %s', self._sensor)
_LOGGER.debug("Updating Heat sensor: %s", self._sensor)
self._state = self._usrobj.heating_level
@property
@@ -134,7 +134,7 @@ class EightUserSensor(EightSleepUserEntity):
self._userid = self._eight.fetch_userid(self._side)
self._usrobj = self._eight.users[self._userid]
_LOGGER.debug('User Sensor: %s, Side: %s, User: %s',
_LOGGER.debug("User Sensor: %s, Side: %s, User: %s",
self._sensor, self._side, self._userid)
@property
@@ -167,7 +167,7 @@ class EightUserSensor(EightSleepUserEntity):
@asyncio.coroutine
def async_update(self):
"""Retrieve latest state."""
_LOGGER.debug('Updating User sensor: %s', self._sensor)
_LOGGER.debug("Updating User sensor: %s", self._sensor)
if 'current' in self._sensor:
self._state = self._usrobj.current_sleep_score
self._attr = self._usrobj.current_values
@@ -252,7 +252,7 @@ class EightRoomSensor(EightSleepUserEntity):
@asyncio.coroutine
def async_update(self):
"""Retrieve latest state."""
_LOGGER.debug('Updating Room sensor: %s', self._sensor)
_LOGGER.debug("Updating Room sensor: %s", self._sensor)
temp = self._eight.room_temperature()
if self._units == 'si':
self._state = round(temp, 2)
@@ -52,7 +52,7 @@ class OhmconnectSensor(Entity):
@property
def name(self):
"""The name of the sensor."""
"""Return the name of the sensor."""
return self._name
@property
+3 -3
View File
@@ -48,7 +48,7 @@ def setup_platform(hass, config, add_devices, discovery_info=None):
_LOGGER.info("Connected to Zabbix API Version %s", zapi.api_version())
trigger_conf = config.get(_CONF_TRIGGERS)
# The following code seems overly complex. Need to think about this...
# The following code seems overly complex. Need to think about this...
if trigger_conf:
hostids = trigger_conf.get(_CONF_HOSTIDS)
individual = trigger_conf.get(_CONF_INDIVIDUAL)
@@ -90,7 +90,7 @@ class ZabbixTriggerCountSensor(Entity):
"""Get the active trigger count for all Zabbix monitored hosts."""
def __init__(self, zApi, name="Zabbix"):
"""Initiate Zabbix sensor."""
"""Initialize Zabbix sensor."""
self._name = name
self._zapi = zApi
self._state = None
@@ -131,7 +131,7 @@ class ZabbixSingleHostTriggerCountSensor(ZabbixTriggerCountSensor):
"""Get the active trigger count for a single Zabbix monitored host."""
def __init__(self, zApi, hostid, name=None):
"""Initiate Zabbix sensor."""
"""Initialize Zabbix sensor."""
super().__init__(zApi, name)
self._hostid = hostid
if not name:
+1 -1
View File
@@ -30,7 +30,7 @@ def async_setup_platform(hass, config, async_add_devices, discovery_info=None):
@asyncio.coroutine
def make_sensor(discovery_info):
"""Factory function for ZHA sensors."""
"""Create ZHA sensors factory."""
from bellows.zigbee import zcl
if isinstance(discovery_info['clusters'][0],
zcl.clusters.measurement.TemperatureMeasurement):
+1 -1
View File
@@ -67,7 +67,7 @@ class ZigBeeTemperatureSensor(Entity):
@property
def unit_of_measurement(self):
"""Unit the value is expressed in."""
"""Return the unit of measurement the value is expressed in."""
return TEMP_CELSIUS
def update(self, *args):
@@ -51,7 +51,7 @@ class ZMSensorMonitors(Entity):
"""Get the status of each ZoneMinder monitor."""
def __init__(self, monitor_id, monitor_name):
"""Initiate monitor sensor."""
"""Initialize monitor sensor."""
self._monitor_id = monitor_id
self._monitor_name = monitor_name
self._state = None