From 203f48cadc9509f42caa062f016ae8855a9fed82 Mon Sep 17 00:00:00 2001 From: Fabian Affolter Date: Wed, 3 May 2017 10:11:39 +0200 Subject: [PATCH] Update docstrings (#7420) --- homeassistant/components/calendar/__init__.py | 1 - homeassistant/components/calendar/demo.py | 2 +- homeassistant/components/mysensors.py | 1 + homeassistant/components/plant.py | 2 +- homeassistant/components/sensor/knx.py | 3 +-- homeassistant/components/switch/netio.py | 2 +- homeassistant/components/switch/orvibo.py | 2 +- homeassistant/components/switch/rest.py | 4 ++-- homeassistant/components/switch/wemo.py | 2 +- homeassistant/components/telegram_bot/__init__.py | 2 +- 10 files changed, 10 insertions(+), 11 deletions(-) diff --git a/homeassistant/components/calendar/__init__.py b/homeassistant/components/calendar/__init__.py index 6bc8cc3029b..2ccd591db2c 100644 --- a/homeassistant/components/calendar/__init__.py +++ b/homeassistant/components/calendar/__init__.py @@ -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' diff --git a/homeassistant/components/calendar/demo.py b/homeassistant/components/calendar/demo.py index f8ac2eceb53..9f6ad70b58f 100755 --- a/homeassistant/components/calendar/demo.py +++ b/homeassistant/components/calendar/demo.py @@ -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) diff --git a/homeassistant/components/mysensors.py b/homeassistant/components/mysensors.py index ad4b7a4220b..984ff8a4606 100644 --- a/homeassistant/components/mysensors.py +++ b/homeassistant/components/mysensors.py @@ -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 = [] diff --git a/homeassistant/components/plant.py b/homeassistant/components/plant.py index 6fbffc0f040..2215d7c2f30 100644 --- a/homeassistant/components/plant.py +++ b/homeassistant/components/plant.py @@ -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(): diff --git a/homeassistant/components/sensor/knx.py b/homeassistant/components/sensor/knx.py index 1178938ce49..229f8790291 100644 --- a/homeassistant/components/sensor/knx.py +++ b/homeassistant/components/sensor/knx.py @@ -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): diff --git a/homeassistant/components/switch/netio.py b/homeassistant/components/switch/netio.py index 51735a5675f..3351f39eeea 100644 --- a/homeassistant/components/switch/netio.py +++ b/homeassistant/components/switch/netio.py @@ -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 diff --git a/homeassistant/components/switch/orvibo.py b/homeassistant/components/switch/orvibo.py index 8acf398968d..e039a29809d 100644 --- a/homeassistant/components/switch/orvibo.py +++ b/homeassistant/components/switch/orvibo.py @@ -72,7 +72,7 @@ class S20Switch(SwitchDevice): @property def should_poll(self): - """Polling is needed.""" + """Return the polling state.""" return True @property diff --git a/homeassistant/components/switch/rest.py b/homeassistant/components/switch/rest.py index 179b3b24068..419f4028def 100644 --- a/homeassistant/components/switch/rest.py +++ b/homeassistant/components/switch/rest.py @@ -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 diff --git a/homeassistant/components/switch/wemo.py b/homeassistant/components/switch/wemo.py index 083af8549a1..1c6ad76ceba 100644 --- a/homeassistant/components/switch/wemo.py +++ b/homeassistant/components/switch/wemo.py @@ -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)) diff --git a/homeassistant/components/telegram_bot/__init__.py b/homeassistant/components/telegram_bot/__init__.py index f825b6737b9..200c4227f4d 100644 --- a/homeassistant/components/telegram_bot/__init__.py +++ b/homeassistant/components/telegram_bot/__init__.py @@ -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)