Fix PEP257 issues

This commit is contained in:
Fabian Affolter 2016-03-07 23:39:52 +01:00
parent 876978d64a
commit 4f536ac63d
9 changed files with 74 additions and 108 deletions

View file

@ -1,5 +1,4 @@
""" Event Decorators for custom components """
"""Event Decorators for custom components."""
import functools
from homeassistant.helpers import event
@ -8,10 +7,9 @@ HASS = None
def track_state_change(entity_ids, from_state=None, to_state=None):
""" Decorator factory to track state changes for entity id """
"""Decorator factory to track state changes for entity id."""
def track_state_change_decorator(action):
""" Decorator to track state changes """
"""Decorator to track state changes."""
event.track_state_change(HASS, entity_ids,
functools.partial(action, HASS),
from_state, to_state)
@ -21,10 +19,9 @@ def track_state_change(entity_ids, from_state=None, to_state=None):
def track_sunrise(offset=None):
""" Decorator factory to track sunrise events """
"""Decorator factory to track sunrise events."""
def track_sunrise_decorator(action):
""" Decorator to track sunrise events """
"""Decorator to track sunrise events."""
event.track_sunrise(HASS,
functools.partial(action, HASS),
offset)
@ -34,10 +31,9 @@ def track_sunrise(offset=None):
def track_sunset(offset=None):
""" Decorator factory to track sunset events """
"""Decorator factory to track sunset events."""
def track_sunset_decorator(action):
""" Decorator to track sunset events """
"""Decorator to track sunset events."""
event.track_sunset(HASS,
functools.partial(action, HASS),
offset)
@ -49,10 +45,9 @@ def track_sunset(offset=None):
# pylint: disable=too-many-arguments
def track_time_change(year=None, month=None, day=None, hour=None, minute=None,
second=None):
""" Decorator factory to track time changes """
"""Decorator factory to track time changes."""
def track_time_change_decorator(action):
""" Decorator to track time changes """
"""Decorator to track time changes."""
event.track_time_change(HASS,
functools.partial(action, HASS),
year, month, day, hour, minute, second)
@ -64,10 +59,9 @@ def track_time_change(year=None, month=None, day=None, hour=None, minute=None,
# pylint: disable=too-many-arguments
def track_utc_time_change(year=None, month=None, day=None, hour=None,
minute=None, second=None):
""" Decorator factory to track time changes """
"""Decorator factory to track time changes."""
def track_utc_time_change_decorator(action):
""" Decorator to track time changes """
"""Decorator to track time changes."""
event.track_utc_time_change(HASS,
functools.partial(action, HASS),
year, month, day, hour, minute, second)