diff --git a/homeassistant/components/sensor/zha.py b/homeassistant/components/sensor/zha.py index ca4ab6bbff3..cd2847c1fa6 100644 --- a/homeassistant/components/sensor/zha.py +++ b/homeassistant/components/sensor/zha.py @@ -78,7 +78,7 @@ class TemperatureSensor(Sensor): @property def unit_of_measurement(self): - """Return the unit of measurement of this entityy.""" + """Return the unit of measurement of this entity.""" return self.hass.config.units.temperature_unit @property diff --git a/homeassistant/components/zha/__init__.py b/homeassistant/components/zha/__init__.py index 55fb0e41cb2..3cd9446dc4f 100644 --- a/homeassistant/components/zha/__init__.py +++ b/homeassistant/components/zha/__init__.py @@ -14,13 +14,14 @@ from homeassistant import const as ha_const from homeassistant.helpers import discovery, entity from homeassistant.util import slugify -REQUIREMENTS = ['bellows==0.3.4'] +REQUIREMENTS = ['bellows==0.4.0'] DOMAIN = 'zha' -CONF_USB_PATH = 'usb_path' +CONF_BAUDRATE = 'baudrate' CONF_DATABASE = 'database_path' CONF_DEVICE_CONFIG = 'device_config' +CONF_USB_PATH = 'usb_path' DATA_DEVICE_CONFIG = 'zha_device_config' DEVICE_CONFIG_SCHEMA_ENTRY = vol.Schema({ @@ -30,6 +31,7 @@ DEVICE_CONFIG_SCHEMA_ENTRY = vol.Schema({ CONFIG_SCHEMA = vol.Schema({ DOMAIN: vol.Schema({ CONF_USB_PATH: cv.string, + vol.Optional(CONF_BAUDRATE, default=57600): cv.positive_int, CONF_DATABASE: cv.string, vol.Optional(CONF_DEVICE_CONFIG, default={}): vol.Schema({cv.string: DEVICE_CONFIG_SCHEMA_ENTRY}), @@ -41,9 +43,9 @@ ATTR_DURATION = 'duration' SERVICE_PERMIT = 'permit' SERVICE_DESCRIPTIONS = { SERVICE_PERMIT: { - "description": "Allow nodes to join the Zigbee network", + "description": "Allow nodes to join the ZigBee network", "fields": { - "duration": { + ATTR_DURATION: { "description": "Time to permit joins, in seconds", "example": "60", }, @@ -81,7 +83,8 @@ def async_setup(hass, config): ezsp_ = bellows.ezsp.EZSP() usb_path = config[DOMAIN].get(CONF_USB_PATH) - yield from ezsp_.connect(usb_path) + baudrate = config[DOMAIN].get(CONF_BAUDRATE) + yield from ezsp_.connect(usb_path, baudrate) database = config[DOMAIN].get(CONF_DATABASE) APPLICATION_CONTROLLER = ControllerApplication(ezsp_, database) @@ -132,6 +135,10 @@ class ApplicationListener: """Handle device leaving the network.""" pass + def device_removed(self, device): + """Handle device being removed from the network.""" + pass + @asyncio.coroutine def async_device_initialized(self, device, join): """Handle device joined and basic information discovered (async).""" diff --git a/requirements_all.txt b/requirements_all.txt index dfee997dc19..56054ec0bca 100644 --- a/requirements_all.txt +++ b/requirements_all.txt @@ -111,7 +111,7 @@ batinfo==0.4.2 beautifulsoup4==4.6.0 # homeassistant.components.zha -bellows==0.3.4 +bellows==0.4.0 # homeassistant.components.blink blinkpy==0.6.0