Skip to content
Merged
Show file tree
Hide file tree
Changes from 5 commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
13 changes: 11 additions & 2 deletions homeassistant/components/zha/__init__.py
Original file line number Diff line number Diff line change
Expand Up @@ -25,12 +25,14 @@
CONF_RADIO_TYPE, CONF_USB_PATH, DATA_ZHA, DATA_ZHA_BRIDGE_ID,
DATA_ZHA_CONFIG, DATA_ZHA_CORE_COMPONENT, DATA_ZHA_DISPATCHERS,
DATA_ZHA_RADIO, DEFAULT_BAUDRATE, DEFAULT_DATABASE_NAME,
DEFAULT_RADIO_TYPE, DOMAIN, ZHA_DISCOVERY_NEW, RadioType)
DEFAULT_RADIO_TYPE, DOMAIN, ZHA_DISCOVERY_NEW, RadioType,
ENABLE_QUIRKS)

REQUIREMENTS = [
'bellows==0.7.0',
'zigpy==0.2.0',
'zigpy-xbee==0.1.1',
'zha-quirks==0.0.5'
]

DEVICE_CONFIG_SCHEMA_ENTRY = vol.Schema({
Expand All @@ -48,6 +50,7 @@
vol.Optional(CONF_DATABASE): cv.string,
vol.Optional(CONF_DEVICE_CONFIG, default={}):
vol.Schema({cv.string: DEVICE_CONFIG_SCHEMA_ENTRY}),
vol.Optional(ENABLE_QUIRKS, default=True): cv.boolean,
})
}, extra=vol.ALLOW_EXTRA)

Expand Down Expand Up @@ -91,7 +94,8 @@ async def async_setup(hass, config):
context={'source': config_entries.SOURCE_IMPORT},
data={
CONF_USB_PATH: conf[CONF_USB_PATH],
CONF_RADIO_TYPE: conf.get(CONF_RADIO_TYPE).value
CONF_RADIO_TYPE: conf.get(CONF_RADIO_TYPE).value,
ENABLE_QUIRKS: conf[ENABLE_QUIRKS]
}
))
return True
Expand All @@ -102,6 +106,11 @@ async def async_setup_entry(hass, config_entry):

Will automatically load components to support devices found on the network.
"""
if config_entry.data.get(ENABLE_QUIRKS):
# needs to be done here so that the ZHA module is finished loading
# before zhaquirks is imported
import zhaquirks
Comment thread
dmulcahey marked this conversation as resolved.
Outdated

global APPLICATION_CONTROLLER

hass.data[DATA_ZHA] = hass.data.get(DATA_ZHA, {})
Expand Down
1 change: 1 addition & 0 deletions homeassistant/components/zha/const.py
Original file line number Diff line number Diff line change
Expand Up @@ -29,6 +29,7 @@
CONF_RADIO_TYPE = 'radio_type'
CONF_USB_PATH = 'usb_path'
DATA_DEVICE_CONFIG = 'zha_device_config'
ENABLE_QUIRKS = 'enable_quirks'

DEFAULT_RADIO_TYPE = 'ezsp'
DEFAULT_BAUDRATE = 57600
Expand Down
1 change: 1 addition & 0 deletions homeassistant/components/zha/entities/entity.py
Original file line number Diff line number Diff line change
Expand Up @@ -43,6 +43,7 @@ def __init__(self, endpoint, in_clusters, out_clusters, manufacturer,
endpoint.endpoint_id,
kwargs.get('entity_suffix', ''),
)
self._device_state_attributes['friendly_name'] = self.entity_id

self._endpoint = endpoint
self._in_clusters = in_clusters
Expand Down