diff --git a/homeassistant/components/light/blinksticklight.py b/homeassistant/components/light/blinksticklight.py index bbbde10ecc8..d6a6ef465a8 100644 --- a/homeassistant/components/light/blinksticklight.py +++ b/homeassistant/components/light/blinksticklight.py @@ -31,7 +31,7 @@ PLATFORM_SCHEMA = PLATFORM_SCHEMA.extend({ # pylint: disable=unused-argument def setup_platform(hass, config, add_devices, discovery_info=None): - """Add device specified by serial number.""" + """Set up Blinkstick device specified by serial number.""" from blinkstick import blinkstick name = config.get(CONF_NAME) diff --git a/homeassistant/components/light/enocean.py b/homeassistant/components/light/enocean.py index ad4bc381b80..beb9094b1cb 100644 --- a/homeassistant/components/light/enocean.py +++ b/homeassistant/components/light/enocean.py @@ -20,14 +20,13 @@ _LOGGER = logging.getLogger(__name__) CONF_SENDER_ID = 'sender_id' DEFAULT_NAME = 'EnOcean Light' - DEPENDENCIES = ['enocean'] SUPPORT_ENOCEAN = SUPPORT_BRIGHTNESS PLATFORM_SCHEMA = PLATFORM_SCHEMA.extend({ - vol.Optional(CONF_ID, default=[]): vol.All(cv.ensure_list, - [vol.Coerce(int)]), + vol.Optional(CONF_ID, default=[]): + vol.All(cv.ensure_list, [vol.Coerce(int)]), vol.Required(CONF_SENDER_ID): vol.All(cv.ensure_list, [vol.Coerce(int)]), vol.Optional(CONF_NAME, default=DEFAULT_NAME): cv.string, }) diff --git a/homeassistant/components/light/flux_led.py b/homeassistant/components/light/flux_led.py index 4b9bed10201..499ec8f74ab 100644 --- a/homeassistant/components/light/flux_led.py +++ b/homeassistant/components/light/flux_led.py @@ -35,26 +35,26 @@ SUPPORT_FLUX_LED_RGBW = (SUPPORT_WHITE_VALUE | SUPPORT_EFFECT | MODE_RGB = 'rgb' MODE_RGBW = 'rgbw' -# List of Supported Effects which aren't already declared in LIGHT -EFFECT_RED_FADE = "red_fade" -EFFECT_GREEN_FADE = "green_fade" -EFFECT_BLUE_FADE = "blue_fade" -EFFECT_YELLOW_FADE = "yellow_fade" -EFFECT_CYAN_FADE = "cyan_fade" -EFFECT_PURPLE_FADE = "purple_fade" -EFFECT_WHITE_FADE = "white_fade" -EFFECT_RED_GREEN_CROSS_FADE = "rg_cross_fade" -EFFECT_RED_BLUE_CROSS_FADE = "rb_cross_fade" -EFFECT_GREEN_BLUE_CROSS_FADE = "gb_cross_fade" -EFFECT_COLORSTROBE = "colorstrobe" -EFFECT_RED_STROBE = "red_strobe" -EFFECT_GREEN_STROBE = "green_strobe" -EFFECT_BLUE_STOBE = "blue_strobe" -EFFECT_YELLOW_STROBE = "yellow_strobe" -EFFECT_CYAN_STROBE = "cyan_strobe" -EFFECT_PURPLE_STROBE = "purple_strobe" -EFFECT_WHITE_STROBE = "white_strobe" -EFFECT_COLORJUMP = "colorjump" +# List of supported effects which aren't already declared in LIGHT +EFFECT_RED_FADE = 'red_fade' +EFFECT_GREEN_FADE = 'green_fade' +EFFECT_BLUE_FADE = 'blue_fade' +EFFECT_YELLOW_FADE = 'yellow_fade' +EFFECT_CYAN_FADE = 'cyan_fade' +EFFECT_PURPLE_FADE = 'purple_fade' +EFFECT_WHITE_FADE = 'white_fade' +EFFECT_RED_GREEN_CROSS_FADE = 'rg_cross_fade' +EFFECT_RED_BLUE_CROSS_FADE = 'rb_cross_fade' +EFFECT_GREEN_BLUE_CROSS_FADE = 'gb_cross_fade' +EFFECT_COLORSTROBE = 'colorstrobe' +EFFECT_RED_STROBE = 'red_strobe' +EFFECT_GREEN_STROBE = 'green_strobe' +EFFECT_BLUE_STOBE = 'blue_strobe' +EFFECT_YELLOW_STROBE = 'yellow_strobe' +EFFECT_CYAN_STROBE = 'cyan_strobe' +EFFECT_PURPLE_STROBE = 'purple_strobe' +EFFECT_WHITE_STROBE = 'white_strobe' +EFFECT_COLORJUMP = 'colorjump' FLUX_EFFECT_LIST = [ EFFECT_COLORLOOP, @@ -121,7 +121,7 @@ def setup_platform(hass, config, add_devices, discovery_info=None): ipaddr = device['ipaddr'] if ipaddr in light_ips: continue - device['name'] = device['id'] + " " + ipaddr + device['name'] = '{} {}'.format(device['id'], ipaddr) device[ATTR_MODE] = 'rgbw' device[CONF_PROTOCOL] = None light = FluxLight(device) @@ -167,7 +167,7 @@ class FluxLight(Light): @property def unique_id(self): """Return the ID of this light.""" - return "{}.{}".format(self.__class__, self._ipaddr) + return '{}.{}'.format(self.__class__, self._ipaddr) @property def name(self): diff --git a/homeassistant/components/light/insteon_local.py b/homeassistant/components/light/insteon_local.py index f7beb0c31ac..e5b99ca1cb2 100644 --- a/homeassistant/components/light/insteon_local.py +++ b/homeassistant/components/light/insteon_local.py @@ -84,7 +84,7 @@ def setup_light(device_id, name, insteonhub, hass, add_devices_callback): request_id = _CONFIGURING.pop(device_id) configurator = get_component('configurator') configurator.request_done(request_id) - _LOGGER.info("Device configuration done!") + _LOGGER.debug("Device configuration done") conf_lights = config_from_file(hass.config.path(INSTEON_LOCAL_LIGHTS_CONF)) if device_id not in conf_lights: @@ -107,7 +107,7 @@ def config_from_file(filename, config=None): with open(filename, 'w') as fdesc: fdesc.write(json.dumps(config)) except IOError as error: - _LOGGER.error('Saving config file failed: %s', error) + _LOGGER.error("Saving config file failed: %s", error) return False return True else: diff --git a/homeassistant/components/light/insteon_plm.py b/homeassistant/components/light/insteon_plm.py index 2cd22cf6d4d..3b3dd43f496 100644 --- a/homeassistant/components/light/insteon_plm.py +++ b/homeassistant/components/light/insteon_plm.py @@ -1,5 +1,5 @@ """ -Support for INSTEON lights via PowerLinc Modem. +Support for Insteon lights via PowerLinc Modem. For more details about this component, please refer to the documentation at https://home-assistant.io/components/insteon_plm/ @@ -12,16 +12,16 @@ from homeassistant.components.light import ( ATTR_BRIGHTNESS, SUPPORT_BRIGHTNESS, Light) from homeassistant.loader import get_component +_LOGGER = logging.getLogger(__name__) + DEPENDENCIES = ['insteon_plm'] MAX_BRIGHTNESS = 255 -_LOGGER = logging.getLogger(__name__) - @asyncio.coroutine def async_setup_platform(hass, config, async_add_devices, discovery_info=None): - """Set up the INSTEON PLM device class for the hass platform.""" + """Set up the Insteon PLM device.""" plm = hass.data['insteon_plm'] device_list = [] @@ -30,7 +30,7 @@ def async_setup_platform(hass, config, async_add_devices, discovery_info=None): address = device.get('address_hex') dimmable = bool('dimmable' in device.get('capabilities')) - _LOGGER.info('Registered %s with light platform.', name) + _LOGGER.info("Registered %s with light platform", name) device_list.append( InsteonPLMDimmerDevice(hass, plm, address, name, dimmable) @@ -72,14 +72,14 @@ class InsteonPLMDimmerDevice(Light): def brightness(self): """Return the brightness of this light between 0..255.""" onlevel = self._plm.get_device_attr(self._address, 'onlevel') - _LOGGER.debug('on level for %s is %s', self._address, onlevel) + _LOGGER.debug("on level for %s is %s", self._address, onlevel) return int(onlevel) @property def is_on(self): """Return the boolean response if the node is on.""" onlevel = self._plm.get_device_attr(self._address, 'onlevel') - _LOGGER.debug('on level for %s is %s', self._address, onlevel) + _LOGGER.debug("on level for %s is %s", self._address, onlevel) return bool(onlevel) @property @@ -101,7 +101,7 @@ class InsteonPLMDimmerDevice(Light): @callback def async_light_update(self, message): """Receive notification from transport that new data exists.""" - _LOGGER.info('Received update calback from PLM for %s', self._address) + _LOGGER.info("Received update calback from PLM for %s", self._address) self._hass.async_add_job(self.async_update_ha_state()) @asyncio.coroutine diff --git a/homeassistant/components/light/isy994.py b/homeassistant/components/light/isy994.py index 1cde50de820..10feecca518 100644 --- a/homeassistant/components/light/isy994.py +++ b/homeassistant/components/light/isy994.py @@ -24,13 +24,12 @@ def setup_platform(hass, config: ConfigType, add_devices: Callable[[list], None], discovery_info=None): """Set up the ISY994 light platform.""" if isy.ISY is None or not isy.ISY.connected: - _LOGGER.error('A connection has not been made to the ISY controller.') + _LOGGER.error("A connection has not been made to the ISY controller") return False devices = [] - for node in isy.filter_nodes(isy.NODES, units=UOM, - states=STATES): + for node in isy.filter_nodes(isy.NODES, units=UOM, states=STATES): if node.dimmable or '51' in node.uom: devices.append(ISYLightDevice(node)) @@ -57,12 +56,12 @@ class ISYLightDevice(isy.ISYDevice, Light): def turn_off(self, **kwargs) -> None: """Send the turn off command to the ISY994 light device.""" if not self._node.off(): - _LOGGER.debug('Unable to turn on light.') + _LOGGER.debug("Unable to turn on light") def turn_on(self, brightness=None, **kwargs) -> None: """Send the turn on command to the ISY994 light device.""" if not self._node.on(val=brightness): - _LOGGER.debug('Unable to turn on light.') + _LOGGER.debug("Unable to turn on light") @property def supported_features(self): diff --git a/homeassistant/components/light/limitlessled.py b/homeassistant/components/light/limitlessled.py index bb2fd5a60f3..c3bf8d807da 100644 --- a/homeassistant/components/light/limitlessled.py +++ b/homeassistant/components/light/limitlessled.py @@ -4,7 +4,6 @@ Support for LimitlessLED bulbs. For more details about this platform, please refer to the documentation at https://home-assistant.io/components/light.limitlessled/ """ - import logging import voluptuous as vol diff --git a/homeassistant/components/light/tradfri.py b/homeassistant/components/light/tradfri.py index 016771a15ca..fdd02d73349 100644 --- a/homeassistant/components/light/tradfri.py +++ b/homeassistant/components/light/tradfri.py @@ -1,4 +1,9 @@ -"""Support for the IKEA Tradfri platform.""" +""" +Support for the IKEA Tradfri platform. + +For more details about this platform, please refer to the documentation at +https://home-assistant.io/components/light.tradfri/ +""" import logging from homeassistant.components.light import (