diff --git a/homeassistant/components/light/iglo.py b/homeassistant/components/light/iglo.py index eaf783b13ca..11366ffc45c 100644 --- a/homeassistant/components/light/iglo.py +++ b/homeassistant/components/light/iglo.py @@ -5,6 +5,7 @@ For more details about this platform, please refer to the documentation at https://home-assistant.io/components/light.iglo/ """ import logging +import math import voluptuous as vol @@ -16,8 +17,9 @@ from homeassistant.components.light import ( ) import homeassistant.helpers.config_validation as cv +import homeassistant.util.color as color_util -REQUIREMENTS = ['iglo==1.0.0'] +REQUIREMENTS = ['iglo==1.1.3'] _LOGGER = logging.getLogger(__name__) @@ -65,17 +67,19 @@ class IGloLamp(Light): @property def color_temp(self): """Return the color temperature.""" - return self._color_temp + return color_util.color_temperature_kelvin_to_mired(self._color_temp) @property def min_mireds(self): """Return the coldest color_temp that this light supports.""" - return 1 + return math.ceil(color_util.color_temperature_kelvin_to_mired( + self._lamp.max_kelvin)) @property def max_mireds(self): """Return the warmest color_temp that this light supports.""" - return 255 + return math.ceil(color_util.color_temperature_kelvin_to_mired( + self._lamp.min_kelvin)) @property def rgb_color(self): @@ -107,8 +111,9 @@ class IGloLamp(Light): return if ATTR_COLOR_TEMP in kwargs: - color_temp = 255 - kwargs[ATTR_COLOR_TEMP] - self._lamp.white(color_temp) + kelvin = int(color_util.color_temperature_mired_to_kelvin( + kwargs[ATTR_COLOR_TEMP])) + self._lamp.white(kelvin) return def turn_off(self, **kwargs): @@ -121,4 +126,4 @@ class IGloLamp(Light): self._on = state['on'] self._brightness = state['brightness'] self._rgb = state['rgb'] - self._color_temp = 255 - state['white'] + self._color_temp = state['white'] diff --git a/requirements_all.txt b/requirements_all.txt index c949847ec86..2ef38c37aa7 100644 --- a/requirements_all.txt +++ b/requirements_all.txt @@ -396,7 +396,7 @@ https://github.com/wokar/pylgnetcast/archive/v0.2.0.zip#pylgnetcast==0.2.0 # i2csense==0.0.4 # homeassistant.components.light.iglo -iglo==1.0.0 +iglo==1.1.3 # homeassistant.components.influxdb # homeassistant.components.sensor.influxdb