Updated docstrings (#7383)

* Updated docstrings

* Updated docstrings

* Updated docstrings

* Update docstrings

* Update more docstrings
This commit is contained in:
Alok Saboo 2017-04-30 23:10:08 -04:00 committed by Paulus Schoutsen
parent 6aac53399d
commit 86cfc2a0ed
35 changed files with 56 additions and 56 deletions

View file

@ -55,7 +55,7 @@ class NetatmoCamera(Camera):
"""Representation of the images published from a Netatmo camera."""
def __init__(self, data, camera_name, home, camera_type, verify_ssl):
"""Setup for access to the Netatmo camera images."""
"""Set up access to the Netatmo camera images."""
super(NetatmoCamera, self).__init__()
self._data = data
self._camera_name = camera_name

View file

@ -48,7 +48,7 @@ class ProliphixThermostat(ClimateDevice):
@property
def should_poll(self):
"""Polling needed for thermostat."""
"""Set up polling needed for thermostat."""
return True
def update(self):

View file

@ -17,7 +17,7 @@ _LOGGER = logging.getLogger(__name__)
def setup_scanner(hass, config, see, discovery_info=None):
"""Set up the MySensors tracker."""
def mysensors_callback(gateway, msg):
"""Callback for mysensors platform."""
"""Set up callback for mysensors platform."""
node = gateway.sensors[msg.node_id]
if node.sketch_name is None:
_LOGGER.debug("No sketch_name: node %s", msg.node_id)

View file

@ -234,7 +234,7 @@ class Config(object):
return is_default_exposed or explicit_expose
def _load_numbers_json(self):
"""Helper method to load numbers json."""
"""Set up helper method to load numbers json."""
try:
with open(self.hass.config.path(NUMBERS_FILE),
encoding='utf-8') as fil:
@ -247,7 +247,7 @@ class Config(object):
return {}
def _save_numbers_json(self):
"""Helper method to save numbers json."""
"""Set up helper method to save numbers json."""
try:
with open(self.hass.config.path(NUMBERS_FILE), 'w',
encoding='utf-8') as fil:

View file

@ -54,7 +54,7 @@ class BlinkStickLight(Light):
@property
def should_poll(self):
"""Polling needed."""
"""Set up polling."""
return True
@property

View file

@ -273,7 +273,7 @@ def request_configuration(host, hass, add_devices, filename,
# pylint: disable=unused-argument
def hue_configuration_callback(data):
"""The actions to do when our configuration callback is called."""
"""Set up actions to do when our configuration callback is called."""
setup_bridge(host, hass, add_devices, filename, allow_unreachable,
allow_in_emulated_hue, allow_hue_groups)

View file

@ -64,7 +64,7 @@ def request_configuration(device_id, insteonhub, model, hass,
return
def insteon_light_config_callback(data):
"""The actions to do when our configuration callback is called."""
"""Set up actions to do when our configuration callback is called."""
setup_light(device_id, data.get('name'), insteonhub, hass,
add_devices_callback)

View file

@ -121,7 +121,7 @@ class LIFX(object):
# pylint: disable=unused-argument
def poll(self, now):
"""Polling for the light."""
"""Set up polling for the light."""
self.probe()
def probe(self, address=None):

View file

@ -123,7 +123,7 @@ def state(new_state):
Specify True (turn on) or False (turn off).
"""
def decorator(function):
"""Decorator function."""
"""Set up the decorator function."""
# pylint: disable=no-member,protected-access
def wrapper(self, **kwargs):
"""Wrap a group state change."""

View file

@ -57,7 +57,7 @@ class LiteJetLight(Light):
@property
def name(self):
"""The light's name."""
"""Set up the light's name."""
return self._name
@property

View file

@ -82,6 +82,6 @@ class LutronLight(LutronDevice, Light):
return self._lutron_device.last_level() > 0
def update(self):
"""Called when forcing a refresh of the device."""
"""Call when forcing a refresh of the device."""
if self._prev_brightness is None:
self._prev_brightness = to_hass_level(self._lutron_device.level)

View file

@ -59,6 +59,6 @@ class LutronCasetaLight(LutronCasetaDevice, Light):
return self._state["current_state"] > 0
def update(self):
"""Called when forcing a refresh of the device."""
"""Call when forcing a refresh of the device."""
self._state = self._smartbridge.get_device_by_id(self._device_id)
_LOGGER.debug(self._state)

View file

@ -27,7 +27,7 @@ def setup_platform(hass, config, add_devices, discovery_info=None):
add_devices(lights)
def light_update(event):
"""Callback for light updates from the RFXtrx gateway."""
"""Define callback for light updates from the RFXtrx gateway."""
if not isinstance(event.device, rfxtrxmod.LightingDevice) or \
not event.device.known_to_be_dimmable:
return

View file

@ -32,7 +32,7 @@ class TelldusLiveLight(TelldusLiveEntity, Light):
self._last_brightness = self.brightness
def changed(self):
"""A property of the device might have changed."""
"""Define a property of the device that might have changed."""
self._last_brightness = self.brightness
super().changed()

View file

@ -67,5 +67,5 @@ class VeraLight(VeraDevice, Light):
return self._state
def update(self):
"""Called by the vera device callback to update state."""
"""Call to update state."""
self._state = self.vera_device.is_switched_on()

View file

@ -97,7 +97,7 @@ class WemoLight(Light):
@property
def is_on(self):
"""True if device is on."""
"""Set True if device is on."""
return self.device.state['onoff'] != 0
@property

View file

@ -53,7 +53,7 @@ class WinkLight(WinkDevice, Light):
@property
def rgb_color(self):
"""Current bulb color in RGB."""
"""Define current bulb color in RGB."""
if not self.wink.supports_hue_saturation():
return None
elif self.wink.color_model() not in RGB_MODES:
@ -72,14 +72,14 @@ class WinkLight(WinkDevice, Light):
@property
def xy_color(self):
"""Current bulb color in CIE 1931 (XY) color space."""
"""Define current bulb color in CIE 1931 (XY) color space."""
if not self.wink.supports_xy_color():
return None
return self.wink.color_xy()
@property
def color_temp(self):
"""Current bulb color in degrees Kelvin."""
"""Define current bulb color in degrees Kelvin."""
if not self.wink.supports_temperature():
return None
return color_util.color_temperature_kelvin_to_mired(

View file

@ -54,7 +54,7 @@ SUPPORT_YEELIGHT_RGB = (SUPPORT_YEELIGHT |
def _cmd(func):
"""A wrapper to catch exceptions from the bulb."""
"""Define a wrapper to catch exceptions from the bulb."""
def _wrap(self, *args, **kwargs):
import yeelight
try:
@ -67,7 +67,7 @@ def _cmd(func):
def setup_platform(hass, config, add_devices, discovery_info=None):
"""Setup the Yeelight bulbs."""
"""Set up Yeelight bulbs."""
lights = []
if discovery_info is not None:
_LOGGER.debug("Adding autodetected %s", discovery_info['hostname'])

View file

@ -113,19 +113,19 @@ class ZwaveDimmer(zwave.ZWaveDeviceEntity, Light):
self._brightness, self._state = brightness_state(self.values.primary)
def value_added(self):
"""Called when a new value is added to this entity."""
"""Call when a new value is added to this entity."""
self._supported_features = SUPPORT_BRIGHTNESS
if self.values.dimming_duration is not None:
self._supported_features |= SUPPORT_TRANSITION
def value_changed(self):
"""Called when a value for this entity's node has changed."""
"""Call when a value for this entity's node has changed."""
if self._refresh_value:
if self._refreshing:
self._refreshing = False
else:
def _refresh_value():
"""Used timer callback for delayed value refresh."""
"""Use timer callback for delayed value refresh."""
self._refreshing = True
self.values.primary.refresh()
@ -218,7 +218,7 @@ class ZwaveColorLight(ZwaveDimmer):
super().__init__(values, refresh, delay)
def value_added(self):
"""Called when a new value is added to this entity."""
"""Call when a new value is added to this entity."""
super().value_added()
self._supported_features |= SUPPORT_RGB_COLOR