Update docstrings (#7420)
This commit is contained in:
parent
1a74c41056
commit
203f48cadc
10 changed files with 10 additions and 11 deletions
|
@ -18,7 +18,6 @@ from homeassistant.helpers.entity_component import EntityComponent
|
||||||
from homeassistant.helpers.template import DATE_STR_FORMAT
|
from homeassistant.helpers.template import DATE_STR_FORMAT
|
||||||
from homeassistant.util import dt
|
from homeassistant.util import dt
|
||||||
|
|
||||||
|
|
||||||
_LOGGER = logging.getLogger(__name__)
|
_LOGGER = logging.getLogger(__name__)
|
||||||
|
|
||||||
DOMAIN = 'calendar'
|
DOMAIN = 'calendar'
|
||||||
|
|
|
@ -77,6 +77,6 @@ class DemoGoogleCalendar(CalendarEventDevice):
|
||||||
"""Representation of a Demo Calendar element."""
|
"""Representation of a Demo Calendar element."""
|
||||||
|
|
||||||
def __init__(self, hass, calendar_data, data):
|
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
|
self.data = calendar_data
|
||||||
super().__init__(hass, data)
|
super().__init__(hass, data)
|
||||||
|
|
|
@ -322,6 +322,7 @@ class GatewayWrapper(object):
|
||||||
optimistic (bool): Send values to actuators without feedback state.
|
optimistic (bool): Send values to actuators without feedback state.
|
||||||
device (str): Device configured as gateway.
|
device (str): Device configured as gateway.
|
||||||
__initialised (bool): True if GatewayWrapper is initialised.
|
__initialised (bool): True if GatewayWrapper is initialised.
|
||||||
|
|
||||||
"""
|
"""
|
||||||
self._wrapped_gateway = gateway
|
self._wrapped_gateway = gateway
|
||||||
self.platform_callbacks = []
|
self.platform_callbacks = []
|
||||||
|
|
|
@ -136,7 +136,7 @@ class Plant(Entity):
|
||||||
}
|
}
|
||||||
|
|
||||||
def __init__(self, name, config):
|
def __init__(self, name, config):
|
||||||
"""Initalize the Plant component."""
|
"""Initialize the Plant component."""
|
||||||
self._config = config
|
self._config = config
|
||||||
self._sensormap = dict()
|
self._sensormap = dict()
|
||||||
for reading, entity_id in config['sensors'].items():
|
for reading, entity_id in config['sensors'].items():
|
||||||
|
|
|
@ -33,7 +33,6 @@ KNX_SPEED_MS_MAX = 670760
|
||||||
|
|
||||||
def setup_platform(hass, config, add_entities, discovery_info=None):
|
def setup_platform(hass, config, add_entities, discovery_info=None):
|
||||||
"""Set up the KNX Sensor platform."""
|
"""Set up the KNX Sensor platform."""
|
||||||
# Add KNX Temperature Sensors
|
|
||||||
# KNX Datapoint 9.001 DPT_Value_Temp
|
# KNX Datapoint 9.001 DPT_Value_Temp
|
||||||
if config[CONF_TYPE] == TEMPERATURE:
|
if config[CONF_TYPE] == TEMPERATURE:
|
||||||
minimum_value, maximum_value = \
|
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):
|
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
|
minimum_value = minimum_default
|
||||||
maximum_value = maximum_default
|
maximum_value = maximum_default
|
||||||
if config.get(CONF_MINIMUM):
|
if config.get(CONF_MINIMUM):
|
||||||
|
|
|
@ -126,7 +126,7 @@ class NetioSwitch(SwitchDevice):
|
||||||
"""Provide a Netio linked switch."""
|
"""Provide a Netio linked switch."""
|
||||||
|
|
||||||
def __init__(self, netio, outlet, name):
|
def __init__(self, netio, outlet, name):
|
||||||
"""Initalize the Netio switch."""
|
"""Initialize the Netio switch."""
|
||||||
self._name = name
|
self._name = name
|
||||||
self.outlet = outlet
|
self.outlet = outlet
|
||||||
self.netio = netio
|
self.netio = netio
|
||||||
|
|
|
@ -72,7 +72,7 @@ class S20Switch(SwitchDevice):
|
||||||
|
|
||||||
@property
|
@property
|
||||||
def should_poll(self):
|
def should_poll(self):
|
||||||
"""Polling is needed."""
|
"""Return the polling state."""
|
||||||
return True
|
return True
|
||||||
|
|
||||||
@property
|
@property
|
||||||
|
|
|
@ -62,7 +62,7 @@ def async_setup_platform(hass, config, async_add_devices, discovery_info=None):
|
||||||
req = yield from websession.get(resource)
|
req = yield from websession.get(resource)
|
||||||
|
|
||||||
if req.status >= 400:
|
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
|
return False
|
||||||
|
|
||||||
except (TypeError, ValueError):
|
except (TypeError, ValueError):
|
||||||
|
@ -95,7 +95,7 @@ class RestSwitch(SwitchDevice):
|
||||||
|
|
||||||
@property
|
@property
|
||||||
def name(self):
|
def name(self):
|
||||||
"""The name of the switch."""
|
"""Return the name of the switch."""
|
||||||
return self._name
|
return self._name
|
||||||
|
|
||||||
@property
|
@property
|
||||||
|
|
|
@ -62,7 +62,7 @@ class WemoSwitch(SwitchDevice):
|
||||||
wemo.SUBSCRIPTION_REGISTRY.on(self.wemo, None, self._update_callback)
|
wemo.SUBSCRIPTION_REGISTRY.on(self.wemo, None, self._update_callback)
|
||||||
|
|
||||||
def _update_callback(self, _device, _type, _params):
|
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)
|
_LOGGER.info("Subscription update for %s", _device)
|
||||||
updated = self.wemo.subscription_update(_type, _params)
|
updated = self.wemo.subscription_update(_type, _params)
|
||||||
self._update(force_update=(not updated))
|
self._update(force_update=(not updated))
|
||||||
|
|
|
@ -78,7 +78,7 @@ def async_setup(hass, config):
|
||||||
|
|
||||||
@asyncio.coroutine
|
@asyncio.coroutine
|
||||||
def async_platform_discovered(platform, info):
|
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)
|
yield from async_setup_platform(platform, discovery_info=info)
|
||||||
|
|
||||||
discovery.async_listen_platform(hass, DOMAIN, async_platform_discovered)
|
discovery.async_listen_platform(hass, DOMAIN, async_platform_discovered)
|
||||||
|
|
Loading…
Add table
Add a link
Reference in a new issue