From 7d503e3f8b668748c6db64377b9e0395a600d32e Mon Sep 17 00:00:00 2001 From: Fabian Affolter Date: Sun, 29 Nov 2015 15:52:44 +0100 Subject: [PATCH] Update docstrings --- homeassistant/components/motor/__init__.py | 11 ++++++++--- homeassistant/components/motor/mqtt.py | 13 ++++++++----- homeassistant/components/mqtt/__init__.py | 2 +- 3 files changed, 17 insertions(+), 9 deletions(-) diff --git a/homeassistant/components/motor/__init__.py b/homeassistant/components/motor/__init__.py index 806dd9e0eb1..dda7c52c05d 100644 --- a/homeassistant/components/motor/__init__.py +++ b/homeassistant/components/motor/__init__.py @@ -1,8 +1,10 @@ """ homeassistant.components.motor -~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ +~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ Motor component. +For more details about this platform, please refer to the documentation at +https://home-assistant.io/components/motor/ """ import os import logging @@ -100,12 +102,15 @@ class MotorDevice(Entity): @property def current_position(self): - """ Return current position of motor. - None is unknown, 0 is closed, 100 is fully open. """ + """ + Return current position of motor. + None is unknown, 0 is closed, 100 is fully open. + """ raise NotImplementedError() @property def state(self): + """ Returns the state of the motor. """ current = self.current_position if current is None: diff --git a/homeassistant/components/motor/mqtt.py b/homeassistant/components/motor/mqtt.py index 1075030fc37..7c25e382f84 100644 --- a/homeassistant/components/motor/mqtt.py +++ b/homeassistant/components/motor/mqtt.py @@ -1,7 +1,8 @@ """ homeassistant.components.motor.mqtt -~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ +~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ Allows to configure a MQTT motor. + For more details about this platform, please refer to the documentation at https://home-assistant.io/components/motor.mqtt/ """ @@ -40,7 +41,7 @@ def setup_platform(hass, config, add_devices_callback, discovery_info=None): # pylint: disable=too-many-arguments, too-many-instance-attributes class MqttMotor(MotorDevice): - """ Represents a motor that can be controlled using MQTT """ + """ Represents a motor that can be controlled using MQTT. """ def __init__(self, hass, name, state_topic, command_topic, qos, payload_open, payload_close, payload_stop, state_format): self._state = None @@ -76,13 +77,15 @@ class MqttMotor(MotorDevice): @property def name(self): - """ The name of the motor """ + """ The name of the motor. """ return self._name @property def current_position(self): - """ Return current position of motor. - None is unknown, 0 is closed, 100 is fully open. """ + """ + Return current position of motor. + None is unknown, 0 is closed, 100 is fully open. + """ return self._state def open(self, **kwargs): diff --git a/homeassistant/components/mqtt/__init__.py b/homeassistant/components/mqtt/__init__.py index 0e8506523d2..2c5dbf82923 100644 --- a/homeassistant/components/mqtt/__init__.py +++ b/homeassistant/components/mqtt/__init__.py @@ -138,7 +138,7 @@ def setup(hass, config): # pylint: disable=too-few-public-methods class _JsonFmtParser(object): - """ Implements a json parser on xpath. """ + """ Implements a JSON parser on xpath. """ def __init__(self, jsonpath): import jsonpath_rw self._expr = jsonpath_rw.parse(jsonpath)