Add ZHA Texas Instruments CC device support (#31621)

pull/32128/head
Balazs Sandor 2020-02-09 18:13:22 +01:00 committed by GitHub
parent fb2e120563
commit 41f3fb291a
6 changed files with 31 additions and 11 deletions

View File

@ -96,6 +96,7 @@ DATA_ZHA_GATEWAY = "zha_gateway"
DEBUG_COMP_BELLOWS = "bellows"
DEBUG_COMP_ZHA = "homeassistant.components.zha"
DEBUG_COMP_ZIGPY = "zigpy"
DEBUG_COMP_ZIGPY_CC = "zigpy_cc"
DEBUG_COMP_ZIGPY_DECONZ = "zigpy_deconz"
DEBUG_COMP_ZIGPY_XBEE = "zigpy_xbee"
DEBUG_COMP_ZIGPY_ZIGATE = "zigpy_zigate"
@ -105,8 +106,9 @@ DEBUG_LEVELS = {
DEBUG_COMP_BELLOWS: logging.DEBUG,
DEBUG_COMP_ZHA: logging.DEBUG,
DEBUG_COMP_ZIGPY: logging.DEBUG,
DEBUG_COMP_ZIGPY_XBEE: logging.DEBUG,
DEBUG_COMP_ZIGPY_CC: logging.DEBUG,
DEBUG_COMP_ZIGPY_DECONZ: logging.DEBUG,
DEBUG_COMP_ZIGPY_XBEE: logging.DEBUG,
DEBUG_COMP_ZIGPY_ZIGATE: logging.DEBUG,
}
DEBUG_RELAY_LOGGERS = [DEBUG_COMP_ZHA, DEBUG_COMP_ZIGPY]
@ -131,9 +133,10 @@ POWER_BATTERY_OR_UNKNOWN = "Battery or Unknown"
class RadioType(enum.Enum):
"""Possible options for radio type."""
ezsp = "ezsp"
xbee = "xbee"
deconz = "deconz"
ezsp = "ezsp"
ti_cc = "ti_cc"
xbee = "xbee"
zigate = "zigate"
@classmethod

View File

@ -41,6 +41,7 @@ from .const import (
DEBUG_COMP_BELLOWS,
DEBUG_COMP_ZHA,
DEBUG_COMP_ZIGPY,
DEBUG_COMP_ZIGPY_CC,
DEBUG_COMP_ZIGPY_DECONZ,
DEBUG_COMP_ZIGPY_XBEE,
DEBUG_COMP_ZIGPY_ZIGATE,
@ -555,12 +556,13 @@ def async_capture_log_levels():
DEBUG_COMP_BELLOWS: logging.getLogger(DEBUG_COMP_BELLOWS).getEffectiveLevel(),
DEBUG_COMP_ZHA: logging.getLogger(DEBUG_COMP_ZHA).getEffectiveLevel(),
DEBUG_COMP_ZIGPY: logging.getLogger(DEBUG_COMP_ZIGPY).getEffectiveLevel(),
DEBUG_COMP_ZIGPY_XBEE: logging.getLogger(
DEBUG_COMP_ZIGPY_XBEE
).getEffectiveLevel(),
DEBUG_COMP_ZIGPY_CC: logging.getLogger(DEBUG_COMP_ZIGPY_CC).getEffectiveLevel(),
DEBUG_COMP_ZIGPY_DECONZ: logging.getLogger(
DEBUG_COMP_ZIGPY_DECONZ
).getEffectiveLevel(),
DEBUG_COMP_ZIGPY_XBEE: logging.getLogger(
DEBUG_COMP_ZIGPY_XBEE
).getEffectiveLevel(),
DEBUG_COMP_ZIGPY_ZIGATE: logging.getLogger(
DEBUG_COMP_ZIGPY_ZIGATE
).getEffectiveLevel(),
@ -573,8 +575,9 @@ def async_set_logger_levels(levels):
logging.getLogger(DEBUG_COMP_BELLOWS).setLevel(levels[DEBUG_COMP_BELLOWS])
logging.getLogger(DEBUG_COMP_ZHA).setLevel(levels[DEBUG_COMP_ZHA])
logging.getLogger(DEBUG_COMP_ZIGPY).setLevel(levels[DEBUG_COMP_ZIGPY])
logging.getLogger(DEBUG_COMP_ZIGPY_XBEE).setLevel(levels[DEBUG_COMP_ZIGPY_XBEE])
logging.getLogger(DEBUG_COMP_ZIGPY_CC).setLevel(levels[DEBUG_COMP_ZIGPY_CC])
logging.getLogger(DEBUG_COMP_ZIGPY_DECONZ).setLevel(levels[DEBUG_COMP_ZIGPY_DECONZ])
logging.getLogger(DEBUG_COMP_ZIGPY_XBEE).setLevel(levels[DEBUG_COMP_ZIGPY_XBEE])
logging.getLogger(DEBUG_COMP_ZIGPY_ZIGATE).setLevel(levels[DEBUG_COMP_ZIGPY_ZIGATE])

View File

@ -13,6 +13,8 @@ import bellows.zigbee.application
import zigpy.profiles.zha
import zigpy.profiles.zll
import zigpy.zcl as zcl
import zigpy_cc.api
import zigpy_cc.zigbee.application
import zigpy_deconz.api
import zigpy_deconz.zigbee.application
import zigpy_xbee.api
@ -127,15 +129,20 @@ LIGHT_CLUSTERS = SetRegistry()
OUTPUT_CHANNEL_ONLY_CLUSTERS = SetRegistry()
RADIO_TYPES = {
RadioType.deconz.name: {
ZHA_GW_RADIO: zigpy_deconz.api.Deconz,
CONTROLLER: zigpy_deconz.zigbee.application.ControllerApplication,
ZHA_GW_RADIO_DESCRIPTION: "Deconz",
},
RadioType.ezsp.name: {
ZHA_GW_RADIO: bellows.ezsp.EZSP,
CONTROLLER: bellows.zigbee.application.ControllerApplication,
ZHA_GW_RADIO_DESCRIPTION: "EZSP",
},
RadioType.deconz.name: {
ZHA_GW_RADIO: zigpy_deconz.api.Deconz,
CONTROLLER: zigpy_deconz.zigbee.application.ControllerApplication,
ZHA_GW_RADIO_DESCRIPTION: "Deconz",
RadioType.ti_cc.name: {
ZHA_GW_RADIO: zigpy_cc.api.API,
CONTROLLER: zigpy_cc.zigbee.application.ControllerApplication,
ZHA_GW_RADIO_DESCRIPTION: "TI CC",
},
RadioType.xbee.name: {
ZHA_GW_RADIO: zigpy_xbee.api.XBee,

View File

@ -6,6 +6,7 @@
"requirements": [
"bellows-homeassistant==0.13.2",
"zha-quirks==0.0.32",
"zigpy-cc==0.1.0",
"zigpy-deconz==0.7.0",
"zigpy-homeassistant==0.13.2",
"zigpy-xbee-homeassistant==0.9.0",

View File

@ -2127,6 +2127,9 @@ zhong_hong_hvac==1.0.9
# homeassistant.components.ziggo_mediabox_xl
ziggo-mediabox-xl==1.1.0
# homeassistant.components.zha
zigpy-cc==0.1.0
# homeassistant.components.zha
zigpy-deconz==0.7.0

View File

@ -714,6 +714,9 @@ zeroconf==0.24.4
# homeassistant.components.zha
zha-quirks==0.0.32
# homeassistant.components.zha
zigpy-cc==0.1.0
# homeassistant.components.zha
zigpy-deconz==0.7.0