From e4bbbe20dd2b4f8891f94a104b1cd954114999ee Mon Sep 17 00:00:00 2001 From: Mitesh Patel Date: Tue, 18 Apr 2017 17:24:58 -0500 Subject: [PATCH] Fix id zone mismatch (#7165) * Fixes issue with id mismatch when multiple devices are connected to the lutron bridge * Updates labels * removes no longer needed config values. * removes no longer needed imports --- .../components/light/lutron_caseta.py | 2 +- homeassistant/components/lutron_caseta.py | 20 ++++++++----------- requirements_all.txt | 2 +- 3 files changed, 10 insertions(+), 14 deletions(-) diff --git a/homeassistant/components/light/lutron_caseta.py b/homeassistant/components/light/lutron_caseta.py index e77501e8ce4..705886855b0 100644 --- a/homeassistant/components/light/lutron_caseta.py +++ b/homeassistant/components/light/lutron_caseta.py @@ -42,7 +42,7 @@ class LutronCasetaLight(LutronCasetaDevice, Light): def turn_on(self, **kwargs): """Turn the light on.""" - if ATTR_BRIGHTNESS in kwargs and self._device_type == "WallDimmer": + if ATTR_BRIGHTNESS in kwargs: brightness = kwargs[ATTR_BRIGHTNESS] else: brightness = 255 diff --git a/homeassistant/components/lutron_caseta.py b/homeassistant/components/lutron_caseta.py index 5519240bc49..1e19083e959 100644 --- a/homeassistant/components/lutron_caseta.py +++ b/homeassistant/components/lutron_caseta.py @@ -10,15 +10,13 @@ import logging import voluptuous as vol import homeassistant.helpers.config_validation as cv -from homeassistant.const import (CONF_HOST, - CONF_USERNAME, - CONF_PASSWORD) +from homeassistant.const import CONF_HOST from homeassistant.helpers import discovery from homeassistant.helpers.entity import Entity REQUIREMENTS = ['https://github.com/gurumitts/' - 'pylutron-caseta/archive/v0.2.5.zip#' - 'pylutron-caseta==v0.2.5'] + 'pylutron-caseta/archive/v0.2.6.zip#' + 'pylutron-caseta==v0.2.6'] _LOGGER = logging.getLogger(__name__) @@ -28,9 +26,7 @@ DOMAIN = 'lutron_caseta' CONFIG_SCHEMA = vol.Schema({ DOMAIN: vol.Schema({ - vol.Required(CONF_HOST): cv.string, - vol.Required(CONF_USERNAME): cv.string, - vol.Required(CONF_PASSWORD): cv.string + vol.Required(CONF_HOST): cv.string }) }, extra=vol.ALLOW_EXTRA) @@ -41,9 +37,7 @@ def setup(hass, base_config): config = base_config.get(DOMAIN) hass.data[LUTRON_CASETA_SMARTBRIDGE] = Smartbridge( - hostname=config[CONF_HOST], - username=config[CONF_USERNAME], - password=config[CONF_PASSWORD] + hostname=config[CONF_HOST] ) if not hass.data[LUTRON_CASETA_SMARTBRIDGE].is_connected(): _LOGGER.error("Unable to connect to Lutron smartbridge at %s", @@ -71,6 +65,7 @@ class LutronCasetaDevice(Entity): self._device_id = device["device_id"] self._device_type = device["type"] self._device_name = device["name"] + self._device_zone = device["zone"] self._state = None self._smartbridge = bridge @@ -93,7 +88,8 @@ class LutronCasetaDevice(Entity): @property def device_state_attributes(self): """Return the state attributes.""" - attr = {'Lutron Integration ID': self._device_id} + attr = {'Device ID': self._device_id, + 'Zone ID': self._device_zone} return attr @property diff --git a/requirements_all.txt b/requirements_all.txt index 7ae864fd84e..4583058cdff 100644 --- a/requirements_all.txt +++ b/requirements_all.txt @@ -266,7 +266,7 @@ https://github.com/bah2830/python-roku/archive/3.1.3.zip#roku==3.1.3 https://github.com/bashwork/pymodbus/archive/d7fc4f1cc975631e0a9011390e8017f64b612661.zip#pymodbus==1.2.0 # homeassistant.components.lutron_caseta -https://github.com/gurumitts/pylutron-caseta/archive/v0.2.5.zip#pylutron-caseta==v0.2.5 +https://github.com/gurumitts/pylutron-caseta/archive/v0.2.6.zip#pylutron-caseta==v0.2.6 # homeassistant.components.netatmo https://github.com/jabesq/netatmo-api-python/archive/v0.9.1.zip#lnetatmo==0.9.1