Fix PEP257 issues

This commit is contained in:
Fabian Affolter committed 2016-03-07 22:08:21 +01:00
1 parent f6bc1a4575
commit 7e8e91ef3c
19 files changed
+234 -274

No files matched your search

@@ -1,6 +1,4 @@
"""
homeassistant.components.light.blinksticklight
~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
Support for Blinkstick lights.
For more details about this platform, please refer to the documentation at
@@ -18,7 +16,7 @@ REQUIREMENTS = ["blinkstick==1.1.7"]
# pylint: disable=unused-argument
def setup_platform(hass, config, add_devices_callback, discovery_info=None):
""" Add device specified by serial number. """
"""Add device specified by serial number."""
from blinkstick import blinkstick
stick = blinkstick.find_by_serial(config['serial'])
@@ -27,9 +25,10 @@ def setup_platform(hass, config, add_devices_callback, discovery_info=None):
class BlinkStickLight(Light):
""" Represents a BlinkStick light. """
"""Representation of a BlinkStick light."""
def __init__(self, stick, name):
"""Initialize the light."""
self._stick = stick
self._name = name
self._serial = stick.get_serial()
@@ -37,30 +36,30 @@ class BlinkStickLight(Light):
@property
def should_poll(self):
""" Polling needed. """
"""Polling needed."""
return True
@property
def name(self):
""" The name of the light. """
"""Return the name of the light."""
return self._name
@property
def rgb_color(self):
""" Read back the color of the light. """
"""Read back the color of the light."""
return self._rgb_color
@property
def is_on(self):
""" Check whether any of the LEDs colors are non-zero. """
"""Check whether any of the LEDs colors are non-zero."""
return sum(self._rgb_color) > 0
def update(self):
""" Read back the device state """
"""Read back the device state."""
self._rgb_color = self._stick.get_color()
def turn_on(self, **kwargs):
""" Turn the device on. """
"""Turn the device on."""
if ATTR_RGB_COLOR in kwargs:
self._rgb_color = kwargs[ATTR_RGB_COLOR]
else:
@@ -71,5 +70,5 @@ class BlinkStickLight(Light):
blue=self._rgb_color[2])
def turn_off(self, **kwargs):
""" Turn the device off """
"""Turn the device off."""
self._stick.turn_off()