Fix getting state from iglo (#12685)

This commit is contained in:
Jesse Hills 2018-02-27 20:07:39 +13:00 committed by Paulus Schoutsen
parent 4242411089
commit d052d45712
2 changed files with 7 additions and 7 deletions

View File

@ -17,7 +17,7 @@ from homeassistant.const import CONF_HOST, CONF_NAME, CONF_PORT
import homeassistant.helpers.config_validation as cv import homeassistant.helpers.config_validation as cv
import homeassistant.util.color as color_util import homeassistant.util.color as color_util
REQUIREMENTS = ['iglo==1.2.5'] REQUIREMENTS = ['iglo==1.2.6']
_LOGGER = logging.getLogger(__name__) _LOGGER = logging.getLogger(__name__)
@ -56,13 +56,13 @@ class IGloLamp(Light):
@property @property
def brightness(self): def brightness(self):
"""Return the brightness of this light between 0..255.""" """Return the brightness of this light between 0..255."""
return int((self._lamp.state['brightness'] / 200.0) * 255) return int((self._lamp.state()['brightness'] / 200.0) * 255)
@property @property
def color_temp(self): def color_temp(self):
"""Return the color temperature.""" """Return the color temperature."""
return color_util.color_temperature_kelvin_to_mired( return color_util.color_temperature_kelvin_to_mired(
self._lamp.state['white']) self._lamp.state()['white'])
@property @property
def min_mireds(self): def min_mireds(self):
@ -79,12 +79,12 @@ class IGloLamp(Light):
@property @property
def rgb_color(self): def rgb_color(self):
"""Return the RGB value.""" """Return the RGB value."""
return self._lamp.state['rgb'] return self._lamp.state()['rgb']
@property @property
def effect(self): def effect(self):
"""Return the current effect.""" """Return the current effect."""
return self._lamp.state['effect'] return self._lamp.state()['effect']
@property @property
def effect_list(self): def effect_list(self):
@ -100,7 +100,7 @@ class IGloLamp(Light):
@property @property
def is_on(self): def is_on(self):
"""Return true if light is on.""" """Return true if light is on."""
return self._lamp.state['on'] return self._lamp.state()['on']
def turn_on(self, **kwargs): def turn_on(self, **kwargs):
"""Turn the light on.""" """Turn the light on."""

View File

@ -400,7 +400,7 @@ https://github.com/wokar/pylgnetcast/archive/v0.2.0.zip#pylgnetcast==0.2.0
# i2csense==0.0.4 # i2csense==0.0.4
# homeassistant.components.light.iglo # homeassistant.components.light.iglo
iglo==1.2.5 iglo==1.2.6
# homeassistant.components.ihc # homeassistant.components.ihc
ihcsdk==2.1.1 ihcsdk==2.1.1