Add link to docs and modify docstrings to match PEP257
This commit is contained in:
parent
3f82b9d6b0
commit
4563c54a3e
13 changed files with 155 additions and 152 deletions
|
@ -1,11 +1,14 @@
|
|||
"""
|
||||
Demo platform that has two fake binary sensors.
|
||||
|
||||
For more details about this platform, please refer to the documentation
|
||||
https://home-assistant.io/components/demo/
|
||||
"""
|
||||
from homeassistant.components.binary_sensor import BinarySensorDevice
|
||||
|
||||
|
||||
def setup_platform(hass, config, add_devices, discovery_info=None):
|
||||
"""Sets up the Demo binary sensors """
|
||||
"""Setup the Demo binary sensor platform."""
|
||||
add_devices([
|
||||
DemoBinarySensor('Basement Floor Wet', False, 'moisture'),
|
||||
DemoBinarySensor('Movement Backyard', True, 'motion'),
|
||||
|
@ -14,7 +17,6 @@ def setup_platform(hass, config, add_devices, discovery_info=None):
|
|||
|
||||
class DemoBinarySensor(BinarySensorDevice):
|
||||
"""A Demo binary sensor."""
|
||||
|
||||
def __init__(self, name, state, sensor_class):
|
||||
self._name = name
|
||||
self._state = state
|
||||
|
@ -32,10 +34,10 @@ class DemoBinarySensor(BinarySensorDevice):
|
|||
|
||||
@property
|
||||
def name(self):
|
||||
"""Returns the name of the binary sensor."""
|
||||
"""Return the name of the binary sensor."""
|
||||
return self._name
|
||||
|
||||
@property
|
||||
def is_on(self):
|
||||
"""True if the binary sensor is on."""
|
||||
"""Return true if the binary sensor is on."""
|
||||
return self._state
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue