Fix docstrings

This commit is contained in:
Fabian Affolter 2016-02-01 11:31:27 +01:00
parent 79b6269aa2
commit 8de56bc8e2

View file

@ -21,7 +21,7 @@ DEFAULT_METHOD = 'GET'
# pylint: disable=unused-variable # pylint: disable=unused-variable
def setup_platform(hass, config, add_devices, discovery_info=None): def setup_platform(hass, config, add_devices, discovery_info=None):
"""Setup REST binary sensors.""" """ Setup REST binary sensors. """
resource = config.get('resource', None) resource = config.get('resource', None)
method = config.get('method', DEFAULT_METHOD) method = config.get('method', DEFAULT_METHOD)
payload = config.get('payload', None) payload = config.get('payload', None)
@ -41,10 +41,10 @@ def setup_platform(hass, config, add_devices, discovery_info=None):
# pylint: disable=too-many-arguments # pylint: disable=too-many-arguments
class RestBinarySensor(BinarySensorDevice): class RestBinarySensor(BinarySensorDevice):
"""REST binary sensor.""" """ A REST binary sensor. """
def __init__(self, hass, rest, name, value_template): def __init__(self, hass, rest, name, value_template):
"""Initialize a REST binary sensor.""" """ Initialize a REST binary sensor. """
self._hass = hass self._hass = hass
self.rest = rest self.rest = rest
self._name = name self._name = name
@ -54,12 +54,12 @@ class RestBinarySensor(BinarySensorDevice):
@property @property
def name(self): def name(self):
"""Name of the binary sensor.""" """ Name of the binary sensor. """
return self._name return self._name
@property @property
def is_on(self): def is_on(self):
"""Return if the binary sensor is on.""" """ Return if the binary sensor is on. """
if self.rest.data is None: if self.rest.data is None:
return False return False
@ -69,5 +69,5 @@ class RestBinarySensor(BinarySensorDevice):
return bool(int(self.rest.data)) return bool(int(self.rest.data))
def update(self): def update(self):
"""Get the latest data from REST API and updates the state.""" """ Get the latest data from REST API and updates the state. """
self.rest.update() self.rest.update()