parent
c37883c9a9
commit
7596ac23fc
3 changed files with 14 additions and 7 deletions
|
@ -78,7 +78,7 @@ class TemperatureSensor(Sensor):
|
||||||
|
|
||||||
@property
|
@property
|
||||||
def unit_of_measurement(self):
|
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
|
return self.hass.config.units.temperature_unit
|
||||||
|
|
||||||
@property
|
@property
|
||||||
|
|
|
@ -14,13 +14,14 @@ from homeassistant import const as ha_const
|
||||||
from homeassistant.helpers import discovery, entity
|
from homeassistant.helpers import discovery, entity
|
||||||
from homeassistant.util import slugify
|
from homeassistant.util import slugify
|
||||||
|
|
||||||
REQUIREMENTS = ['bellows==0.3.4']
|
REQUIREMENTS = ['bellows==0.4.0']
|
||||||
|
|
||||||
DOMAIN = 'zha'
|
DOMAIN = 'zha'
|
||||||
|
|
||||||
CONF_USB_PATH = 'usb_path'
|
CONF_BAUDRATE = 'baudrate'
|
||||||
CONF_DATABASE = 'database_path'
|
CONF_DATABASE = 'database_path'
|
||||||
CONF_DEVICE_CONFIG = 'device_config'
|
CONF_DEVICE_CONFIG = 'device_config'
|
||||||
|
CONF_USB_PATH = 'usb_path'
|
||||||
DATA_DEVICE_CONFIG = 'zha_device_config'
|
DATA_DEVICE_CONFIG = 'zha_device_config'
|
||||||
|
|
||||||
DEVICE_CONFIG_SCHEMA_ENTRY = vol.Schema({
|
DEVICE_CONFIG_SCHEMA_ENTRY = vol.Schema({
|
||||||
|
@ -30,6 +31,7 @@ DEVICE_CONFIG_SCHEMA_ENTRY = vol.Schema({
|
||||||
CONFIG_SCHEMA = vol.Schema({
|
CONFIG_SCHEMA = vol.Schema({
|
||||||
DOMAIN: vol.Schema({
|
DOMAIN: vol.Schema({
|
||||||
CONF_USB_PATH: cv.string,
|
CONF_USB_PATH: cv.string,
|
||||||
|
vol.Optional(CONF_BAUDRATE, default=57600): cv.positive_int,
|
||||||
CONF_DATABASE: cv.string,
|
CONF_DATABASE: cv.string,
|
||||||
vol.Optional(CONF_DEVICE_CONFIG, default={}):
|
vol.Optional(CONF_DEVICE_CONFIG, default={}):
|
||||||
vol.Schema({cv.string: DEVICE_CONFIG_SCHEMA_ENTRY}),
|
vol.Schema({cv.string: DEVICE_CONFIG_SCHEMA_ENTRY}),
|
||||||
|
@ -41,9 +43,9 @@ ATTR_DURATION = 'duration'
|
||||||
SERVICE_PERMIT = 'permit'
|
SERVICE_PERMIT = 'permit'
|
||||||
SERVICE_DESCRIPTIONS = {
|
SERVICE_DESCRIPTIONS = {
|
||||||
SERVICE_PERMIT: {
|
SERVICE_PERMIT: {
|
||||||
"description": "Allow nodes to join the Zigbee network",
|
"description": "Allow nodes to join the ZigBee network",
|
||||||
"fields": {
|
"fields": {
|
||||||
"duration": {
|
ATTR_DURATION: {
|
||||||
"description": "Time to permit joins, in seconds",
|
"description": "Time to permit joins, in seconds",
|
||||||
"example": "60",
|
"example": "60",
|
||||||
},
|
},
|
||||||
|
@ -81,7 +83,8 @@ def async_setup(hass, config):
|
||||||
|
|
||||||
ezsp_ = bellows.ezsp.EZSP()
|
ezsp_ = bellows.ezsp.EZSP()
|
||||||
usb_path = config[DOMAIN].get(CONF_USB_PATH)
|
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)
|
database = config[DOMAIN].get(CONF_DATABASE)
|
||||||
APPLICATION_CONTROLLER = ControllerApplication(ezsp_, database)
|
APPLICATION_CONTROLLER = ControllerApplication(ezsp_, database)
|
||||||
|
@ -132,6 +135,10 @@ class ApplicationListener:
|
||||||
"""Handle device leaving the network."""
|
"""Handle device leaving the network."""
|
||||||
pass
|
pass
|
||||||
|
|
||||||
|
def device_removed(self, device):
|
||||||
|
"""Handle device being removed from the network."""
|
||||||
|
pass
|
||||||
|
|
||||||
@asyncio.coroutine
|
@asyncio.coroutine
|
||||||
def async_device_initialized(self, device, join):
|
def async_device_initialized(self, device, join):
|
||||||
"""Handle device joined and basic information discovered (async)."""
|
"""Handle device joined and basic information discovered (async)."""
|
||||||
|
|
|
@ -111,7 +111,7 @@ batinfo==0.4.2
|
||||||
beautifulsoup4==4.6.0
|
beautifulsoup4==4.6.0
|
||||||
|
|
||||||
# homeassistant.components.zha
|
# homeassistant.components.zha
|
||||||
bellows==0.3.4
|
bellows==0.4.0
|
||||||
|
|
||||||
# homeassistant.components.blink
|
# homeassistant.components.blink
|
||||||
blinkpy==0.6.0
|
blinkpy==0.6.0
|
||||||
|
|
Loading…
Add table
Add a link
Reference in a new issue