From bef2f87ddc5e96a6d1d241b4270b4e1a6eaf871e Mon Sep 17 00:00:00 2001 From: Fabian Affolter Date: Tue, 12 Jul 2016 16:46:29 +0200 Subject: [PATCH] Docstrings (#2502) * Update docstrings * Update docstrings * Add link to docs --- .../components/alarm_control_panel/simplisafe.py | 6 +++--- homeassistant/components/camera/demo.py | 2 +- homeassistant/components/light/demo.py | 4 ++-- homeassistant/components/sensor/imap.py | 9 +++++---- homeassistant/components/sensor/mysensors.py | 4 ++-- homeassistant/components/switch/demo.py | 2 +- 6 files changed, 14 insertions(+), 13 deletions(-) diff --git a/homeassistant/components/alarm_control_panel/simplisafe.py b/homeassistant/components/alarm_control_panel/simplisafe.py index 5b7ba5d4da6..a248df5fc21 100644 --- a/homeassistant/components/alarm_control_panel/simplisafe.py +++ b/homeassistant/components/alarm_control_panel/simplisafe.py @@ -2,7 +2,7 @@ Interfaces with SimpliSafe alarm control panel. For more details about this platform, please refer to the documentation at -https://home-assistant.io/components/simplisafe/ +https://home-assistant.io/components/alarm_control_panel.simplisafe/ """ import logging @@ -36,10 +36,10 @@ def setup_platform(hass, config, add_devices, discovery_info=None): # pylint: disable=abstract-method class SimpliSafeAlarm(alarm.AlarmControlPanel): - """Represents a SimpliSafe alarm status.""" + """Representation a SimpliSafe alarm.""" def __init__(self, name, username, password, code): - """Initialize the SimpliSafe alaram.""" + """Initialize the SimpliSafe alarm.""" from simplisafe import SimpliSafe self.simplisafe = SimpliSafe(username, password) self._name = name diff --git a/homeassistant/components/camera/demo.py b/homeassistant/components/camera/demo.py index e3ab0d6b059..5e451c48b40 100644 --- a/homeassistant/components/camera/demo.py +++ b/homeassistant/components/camera/demo.py @@ -18,7 +18,7 @@ def setup_platform(hass, config, add_devices, discovery_info=None): class DemoCamera(Camera): - """A Demo camera.""" + """The representation of a Demo camera.""" def __init__(self, name): """Initialize demo camera component.""" diff --git a/homeassistant/components/light/demo.py b/homeassistant/components/light/demo.py index ddca6e0a9b5..96095c49a39 100644 --- a/homeassistant/components/light/demo.py +++ b/homeassistant/components/light/demo.py @@ -18,7 +18,7 @@ LIGHT_TEMPS = [240, 380] def setup_platform(hass, config, add_devices_callback, discovery_info=None): - """Setup demo light platform.""" + """Setup the demo light platform.""" add_devices_callback([ DemoLight("Bed Light", False), DemoLight("Ceiling Lights", True, LIGHT_COLORS[0], LIGHT_TEMPS[1]), @@ -27,7 +27,7 @@ def setup_platform(hass, config, add_devices_callback, discovery_info=None): class DemoLight(Light): - """Provide a demo light.""" + """Represenation of a demo light.""" # pylint: disable=too-many-arguments def __init__(self, name, state, rgb=None, ct=None, brightness=180): diff --git a/homeassistant/components/sensor/imap.py b/homeassistant/components/sensor/imap.py index da9e353393b..2d5a1484d14 100644 --- a/homeassistant/components/sensor/imap.py +++ b/homeassistant/components/sensor/imap.py @@ -1,7 +1,8 @@ """ -Imap sensor support. +IMAP sensor support. -Checks an email account for unread emails. +For more details about this platform, please refer to the documentation at +https://home-assistant.io/components/sensor.imap/ """ import logging import voluptuous as vol @@ -47,7 +48,7 @@ def setup_platform(hass, config, add_devices, discovery_info=None): class ImapSensor(Entity): - """IMAP sensor class.""" + """Representation of an IMAP sensor.""" # pylint: disable=too-many-arguments def __init__(self, name, user, password, server, port): @@ -62,7 +63,7 @@ class ImapSensor(Entity): self.update() def _login(self): - """Login and return a imap connection.""" + """Login and return an IMAP connection.""" import imaplib try: connection = imaplib.IMAP4_SSL(self._server, self._port) diff --git a/homeassistant/components/sensor/mysensors.py b/homeassistant/components/sensor/mysensors.py index c6b2e5aa86c..b58a375755c 100644 --- a/homeassistant/components/sensor/mysensors.py +++ b/homeassistant/components/sensor/mysensors.py @@ -15,7 +15,7 @@ DEPENDENCIES = [] def setup_platform(hass, config, add_devices, discovery_info=None): - """Setup the mysensors platform for sensors.""" + """Setup the MySensors platform for sensors.""" # Only act if loaded via mysensors by discovery event. # Otherwise gateway is not setup. if discovery_info is None: @@ -72,7 +72,7 @@ def setup_platform(hass, config, add_devices, discovery_info=None): class MySensorsSensor(mysensors.MySensorsDeviceEntity, Entity): - """Represent the value of a MySensors Sensor child node.""" + """Representation of a MySensors Sensor child node.""" @property def state(self): diff --git a/homeassistant/components/switch/demo.py b/homeassistant/components/switch/demo.py index afbbabab06e..f867473d441 100644 --- a/homeassistant/components/switch/demo.py +++ b/homeassistant/components/switch/demo.py @@ -18,7 +18,7 @@ def setup_platform(hass, config, add_devices_callback, discovery_info=None): class DemoSwitch(SwitchDevice): - """representation of a demo switch.""" + """Representation of a demo switch.""" def __init__(self, name, state, icon, assumed): """Initialize the Demo switch."""