mirror of
https://github.com/home-assistant/core.git
synced 2025-08-04 21:25:13 +02:00
More Fixes for flake8
This commit is contained in:
@@ -1,6 +1,6 @@
|
|||||||
import logging
|
import logging
|
||||||
|
|
||||||
from homeassistant.components.light import ATTR_BRIGHTNESS, ATTR_HS_COLOR, ATTR_RGB_COLOR, SUPPORT_BRIGHTNESS, SUPPORT_COLOR, Light, PLATFORM_SCHEMA
|
from homeassistant.components.light import ATTR_BRIGHTNESS, ATTR_HS_COLOR, SUPPORT_BRIGHTNESS, SUPPORT_COLOR, Light
|
||||||
import homeassistant.util.color as color_util
|
import homeassistant.util.color as color_util
|
||||||
|
|
||||||
|
|
||||||
@@ -17,6 +17,7 @@ def setup_platform(hass, config, add_devices, discovery_info=None):
|
|||||||
|
|
||||||
add_devices(AveaLight(bulb) for bulb in nearbyBulbs)
|
add_devices(AveaLight(bulb) for bulb in nearbyBulbs)
|
||||||
|
|
||||||
|
|
||||||
class AveaLight(Light):
|
class AveaLight(Light):
|
||||||
"""Representation of an Avea."""
|
"""Representation of an Avea."""
|
||||||
|
|
||||||
@@ -70,7 +71,6 @@ class AveaLight(Light):
|
|||||||
rgb = color_util.color_hs_to_RGB(*kwargs[ATTR_HS_COLOR])
|
rgb = color_util.color_hs_to_RGB(*kwargs[ATTR_HS_COLOR])
|
||||||
self._light.set_rgb(round(255 * (rgb[0] / 100)), round(255 * (rgb[1] / 100)), round(255 * (rgb[2] / 100)))
|
self._light.set_rgb(round(255 * (rgb[0] / 100)), round(255 * (rgb[1] / 100)), round(255 * (rgb[2] / 100)))
|
||||||
|
|
||||||
|
|
||||||
def turn_off(self, **kwargs):
|
def turn_off(self, **kwargs):
|
||||||
"""Instruct the light to turn off."""
|
"""Instruct the light to turn off."""
|
||||||
self._light.set_brightness(0)
|
self._light.set_brightness(0)
|
||||||
|
Reference in New Issue
Block a user