Update docstrings (#7420)

This commit is contained in:
Fabian Affolter 2017-05-03 10:11:39 +02:00 committed by GitHub
parent 1a74c41056
commit 203f48cadc
10 changed files with 10 additions and 11 deletions

View file

@ -18,7 +18,6 @@ from homeassistant.helpers.entity_component import EntityComponent
from homeassistant.helpers.template import DATE_STR_FORMAT
from homeassistant.util import dt
_LOGGER = logging.getLogger(__name__)
DOMAIN = 'calendar'

View file

@ -77,6 +77,6 @@ class DemoGoogleCalendar(CalendarEventDevice):
"""Representation of a Demo Calendar element."""
def __init__(self, hass, calendar_data, data):
"""Initalize Google Calendar but without the API calls."""
"""Initialize Google Calendar but without the API calls."""
self.data = calendar_data
super().__init__(hass, data)

View file

@ -322,6 +322,7 @@ class GatewayWrapper(object):
optimistic (bool): Send values to actuators without feedback state.
device (str): Device configured as gateway.
__initialised (bool): True if GatewayWrapper is initialised.
"""
self._wrapped_gateway = gateway
self.platform_callbacks = []

View file

@ -136,7 +136,7 @@ class Plant(Entity):
}
def __init__(self, name, config):
"""Initalize the Plant component."""
"""Initialize the Plant component."""
self._config = config
self._sensormap = dict()
for reading, entity_id in config['sensors'].items():

View file

@ -33,7 +33,6 @@ KNX_SPEED_MS_MAX = 670760
def setup_platform(hass, config, add_entities, discovery_info=None):
"""Set up the KNX Sensor platform."""
# Add KNX Temperature Sensors
# KNX Datapoint 9.001 DPT_Value_Temp
if config[CONF_TYPE] == TEMPERATURE:
minimum_value, maximum_value = \
@ -70,7 +69,7 @@ def setup_platform(hass, config, add_entities, discovery_info=None):
def update_and_define_min_max(config, minimum_default, maximum_default):
"""Determinate a min/max value defined in the configuration."""
"""Determine a min/max value defined in the configuration."""
minimum_value = minimum_default
maximum_value = maximum_default
if config.get(CONF_MINIMUM):

View file

@ -126,7 +126,7 @@ class NetioSwitch(SwitchDevice):
"""Provide a Netio linked switch."""
def __init__(self, netio, outlet, name):
"""Initalize the Netio switch."""
"""Initialize the Netio switch."""
self._name = name
self.outlet = outlet
self.netio = netio

View file

@ -72,7 +72,7 @@ class S20Switch(SwitchDevice):
@property
def should_poll(self):
"""Polling is needed."""
"""Return the polling state."""
return True
@property

View file

@ -62,7 +62,7 @@ def async_setup_platform(hass, config, async_add_devices, discovery_info=None):
req = yield from websession.get(resource)
if req.status >= 400:
_LOGGER.error('Got non-ok response from resource: %s', req.status)
_LOGGER.error("Got non-ok response from resource: %s", req.status)
return False
except (TypeError, ValueError):
@ -95,7 +95,7 @@ class RestSwitch(SwitchDevice):
@property
def name(self):
"""The name of the switch."""
"""Return the name of the switch."""
return self._name
@property

View file

@ -62,7 +62,7 @@ class WemoSwitch(SwitchDevice):
wemo.SUBSCRIPTION_REGISTRY.on(self.wemo, None, self._update_callback)
def _update_callback(self, _device, _type, _params):
"""Called by the Wemo device callback to update state."""
"""Update the state by the Wemo device."""
_LOGGER.info("Subscription update for %s", _device)
updated = self.wemo.subscription_update(_type, _params)
self._update(force_update=(not updated))

View file

@ -78,7 +78,7 @@ def async_setup(hass, config):
@asyncio.coroutine
def async_platform_discovered(platform, info):
"""Callback to load a platform."""
"""Handle the loading of a platform."""
yield from async_setup_platform(platform, discovery_info=info)
discovery.async_listen_platform(hass, DOMAIN, async_platform_discovered)