mirror of
https://github.com/home-assistant/core.git
synced 2025-11-07 01:50:18 +00:00
Modify docstrings to match PEP257
This commit is contained in:
@@ -1,6 +1,4 @@
|
||||
"""
|
||||
homeassistant.components.automation.sun
|
||||
~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
|
||||
Offers sun based automation rules.
|
||||
|
||||
For more details about this automation rule, please refer to the documentation
|
||||
@@ -29,7 +27,7 @@ _LOGGER = logging.getLogger(__name__)
|
||||
|
||||
|
||||
def trigger(hass, config, action):
|
||||
""" Listen for events based on config. """
|
||||
"""Listen for events based on configuration."""
|
||||
event = config.get(CONF_EVENT)
|
||||
|
||||
if event is None:
|
||||
@@ -55,7 +53,7 @@ def trigger(hass, config, action):
|
||||
|
||||
|
||||
def if_action(hass, config):
|
||||
""" Wraps action method with sun based condition. """
|
||||
"""Wraps action method with sun based condition."""
|
||||
before = config.get(CONF_BEFORE)
|
||||
after = config.get(CONF_AFTER)
|
||||
|
||||
@@ -106,8 +104,7 @@ def if_action(hass, config):
|
||||
return sun.next_setting(hass) + after_offset
|
||||
|
||||
def time_if():
|
||||
""" Validate time based if-condition """
|
||||
|
||||
"""Validate time based if-condition."""
|
||||
now = dt_util.now()
|
||||
before = before_func()
|
||||
after = after_func()
|
||||
@@ -126,6 +123,7 @@ def if_action(hass, config):
|
||||
|
||||
|
||||
def _parse_offset(raw_offset):
|
||||
"""Parse the offset."""
|
||||
if raw_offset is None:
|
||||
return timedelta(0)
|
||||
|
||||
|
||||
Reference in New Issue
Block a user