mirror of
https://github.com/home-assistant/core.git
synced 2025-07-19 11:17:21 +00:00
Add link to docs and modify docstrings to match PEP257
This commit is contained in:
parent
2b839de854
commit
3f82b9d6b0
@ -1,6 +1,4 @@
|
|||||||
"""
|
"""
|
||||||
homeassistant.components.garage_door
|
|
||||||
~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
|
|
||||||
Component to interface with garage doors that can be controlled remotely.
|
Component to interface with garage doors that can be controlled remotely.
|
||||||
|
|
||||||
For more details about this component, please refer to the documentation
|
For more details about this component, please refer to the documentation
|
||||||
@ -85,10 +83,9 @@ def setup(hass, config):
|
|||||||
class GarageDoorDevice(Entity):
|
class GarageDoorDevice(Entity):
|
||||||
"""Represents a garage door."""
|
"""Represents a garage door."""
|
||||||
# pylint: disable=no-self-use
|
# pylint: disable=no-self-use
|
||||||
|
|
||||||
@property
|
@property
|
||||||
def is_closed(self):
|
def is_closed(self):
|
||||||
""" Is the garage door closed or opened. """
|
"""Return true if door is closed."""
|
||||||
return None
|
return None
|
||||||
|
|
||||||
def close_door(self):
|
def close_door(self):
|
||||||
|
@ -1,7 +1,8 @@
|
|||||||
"""
|
"""
|
||||||
homeassistant.components.garage_door.demo
|
Demo garage door platform that has two fake doors.
|
||||||
~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
|
|
||||||
Demo platform that has two fake garage doors.
|
For more details about this platform, please refer to the documentation
|
||||||
|
https://home-assistant.io/components/demo/
|
||||||
"""
|
"""
|
||||||
from homeassistant.components.garage_door import GarageDoorDevice
|
from homeassistant.components.garage_door import GarageDoorDevice
|
||||||
from homeassistant.const import STATE_CLOSED, STATE_OPEN
|
from homeassistant.const import STATE_CLOSED, STATE_OPEN
|
||||||
@ -9,7 +10,7 @@ from homeassistant.const import STATE_CLOSED, STATE_OPEN
|
|||||||
|
|
||||||
# pylint: disable=unused-argument
|
# pylint: disable=unused-argument
|
||||||
def setup_platform(hass, config, add_devices_callback, discovery_info=None):
|
def setup_platform(hass, config, add_devices_callback, discovery_info=None):
|
||||||
""" Find and return demo garage doors. """
|
"""Setup demo garage door platform."""
|
||||||
add_devices_callback([
|
add_devices_callback([
|
||||||
DemoGarageDoor('Left Garage Door', STATE_CLOSED),
|
DemoGarageDoor('Left Garage Door', STATE_CLOSED),
|
||||||
DemoGarageDoor('Right Garage Door', STATE_OPEN)
|
DemoGarageDoor('Right Garage Door', STATE_OPEN)
|
||||||
|
@ -1,6 +1,4 @@
|
|||||||
"""
|
"""
|
||||||
homeassistant.components.garage_door.wink
|
|
||||||
~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
|
|
||||||
Support for Wink garage doors.
|
Support for Wink garage doors.
|
||||||
|
|
||||||
For more details about this platform, please refer to the documentation at
|
For more details about this platform, please refer to the documentation at
|
||||||
@ -15,7 +13,7 @@ REQUIREMENTS = ['python-wink==0.6.1']
|
|||||||
|
|
||||||
|
|
||||||
def setup_platform(hass, config, add_devices, discovery_info=None):
|
def setup_platform(hass, config, add_devices, discovery_info=None):
|
||||||
""" Sets up the Wink platform. """
|
"""Sets up the Wink garage door platform."""
|
||||||
import pywink
|
import pywink
|
||||||
|
|
||||||
if discovery_info is None:
|
if discovery_info is None:
|
||||||
@ -41,7 +39,7 @@ class WinkGarageDoorDevice(GarageDoorDevice):
|
|||||||
|
|
||||||
@property
|
@property
|
||||||
def unique_id(self):
|
def unique_id(self):
|
||||||
""" Returns the id of this wink garage door """
|
"""Returns the id of this wink garage door."""
|
||||||
return "{}.{}".format(self.__class__, self.wink.device_id())
|
return "{}.{}".format(self.__class__, self.wink.device_id())
|
||||||
|
|
||||||
@property
|
@property
|
||||||
@ -55,13 +53,13 @@ class WinkGarageDoorDevice(GarageDoorDevice):
|
|||||||
|
|
||||||
@property
|
@property
|
||||||
def is_closed(self):
|
def is_closed(self):
|
||||||
""" True if device is closed. """
|
"""Returns true if door is closed."""
|
||||||
return self.wink.state() == 0
|
return self.wink.state() == 0
|
||||||
|
|
||||||
def close_door(self):
|
def close_door(self):
|
||||||
""" Close the device. """
|
"""Closes the door."""
|
||||||
self.wink.set_state(0)
|
self.wink.set_state(0)
|
||||||
|
|
||||||
def open_door(self):
|
def open_door(self):
|
||||||
""" Open the device. """
|
"""Open the door."""
|
||||||
self.wink.set_state(1)
|
self.wink.set_state(1)
|
||||||
|
Loading…
x
Reference in New Issue
Block a user