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
This commit is contained in:
Mitesh Patel 2017-04-18 17:24:58 -05:00 committed by Pascal Vizeli
parent 1e758ed030
commit e4bbbe20dd
3 changed files with 10 additions and 14 deletions

View File

@ -42,7 +42,7 @@ class LutronCasetaLight(LutronCasetaDevice, Light):
def turn_on(self, **kwargs): def turn_on(self, **kwargs):
"""Turn the light on.""" """Turn the light on."""
if ATTR_BRIGHTNESS in kwargs and self._device_type == "WallDimmer": if ATTR_BRIGHTNESS in kwargs:
brightness = kwargs[ATTR_BRIGHTNESS] brightness = kwargs[ATTR_BRIGHTNESS]
else: else:
brightness = 255 brightness = 255

View File

@ -10,15 +10,13 @@ import logging
import voluptuous as vol import voluptuous as vol
import homeassistant.helpers.config_validation as cv import homeassistant.helpers.config_validation as cv
from homeassistant.const import (CONF_HOST, from homeassistant.const import CONF_HOST
CONF_USERNAME,
CONF_PASSWORD)
from homeassistant.helpers import discovery from homeassistant.helpers import discovery
from homeassistant.helpers.entity import Entity from homeassistant.helpers.entity import Entity
REQUIREMENTS = ['https://github.com/gurumitts/' REQUIREMENTS = ['https://github.com/gurumitts/'
'pylutron-caseta/archive/v0.2.5.zip#' 'pylutron-caseta/archive/v0.2.6.zip#'
'pylutron-caseta==v0.2.5'] 'pylutron-caseta==v0.2.6']
_LOGGER = logging.getLogger(__name__) _LOGGER = logging.getLogger(__name__)
@ -28,9 +26,7 @@ DOMAIN = 'lutron_caseta'
CONFIG_SCHEMA = vol.Schema({ CONFIG_SCHEMA = vol.Schema({
DOMAIN: vol.Schema({ DOMAIN: vol.Schema({
vol.Required(CONF_HOST): cv.string, vol.Required(CONF_HOST): cv.string
vol.Required(CONF_USERNAME): cv.string,
vol.Required(CONF_PASSWORD): cv.string
}) })
}, extra=vol.ALLOW_EXTRA) }, extra=vol.ALLOW_EXTRA)
@ -41,9 +37,7 @@ def setup(hass, base_config):
config = base_config.get(DOMAIN) config = base_config.get(DOMAIN)
hass.data[LUTRON_CASETA_SMARTBRIDGE] = Smartbridge( hass.data[LUTRON_CASETA_SMARTBRIDGE] = Smartbridge(
hostname=config[CONF_HOST], hostname=config[CONF_HOST]
username=config[CONF_USERNAME],
password=config[CONF_PASSWORD]
) )
if not hass.data[LUTRON_CASETA_SMARTBRIDGE].is_connected(): if not hass.data[LUTRON_CASETA_SMARTBRIDGE].is_connected():
_LOGGER.error("Unable to connect to Lutron smartbridge at %s", _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_id = device["device_id"]
self._device_type = device["type"] self._device_type = device["type"]
self._device_name = device["name"] self._device_name = device["name"]
self._device_zone = device["zone"]
self._state = None self._state = None
self._smartbridge = bridge self._smartbridge = bridge
@ -93,7 +88,8 @@ class LutronCasetaDevice(Entity):
@property @property
def device_state_attributes(self): def device_state_attributes(self):
"""Return the state attributes.""" """Return the state attributes."""
attr = {'Lutron Integration ID': self._device_id} attr = {'Device ID': self._device_id,
'Zone ID': self._device_zone}
return attr return attr
@property @property

View File

@ -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 https://github.com/bashwork/pymodbus/archive/d7fc4f1cc975631e0a9011390e8017f64b612661.zip#pymodbus==1.2.0
# homeassistant.components.lutron_caseta # 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 # homeassistant.components.netatmo
https://github.com/jabesq/netatmo-api-python/archive/v0.9.1.zip#lnetatmo==0.9.1 https://github.com/jabesq/netatmo-api-python/archive/v0.9.1.zip#lnetatmo==0.9.1