Bump ZHA quirks and add skip configuration support (#31982)

* add skip configuration
* Bump quirks
* add skip configuration to FakeDevice
pull/32083/head
David F. Mulcahey 2020-02-19 09:19:26 -05:00 committed by GitHub
parent e90d29ea36
commit 8255bdf3d5
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
7 changed files with 16 additions and 11 deletions

View File

@ -194,8 +194,7 @@ class ZigbeeChannel(LogMixin):
async def async_configure(self):
"""Set cluster binding and attribute reporting."""
# Xiaomi devices don't need this and it disrupts pairing
if self._zha_device.manufacturer != "LUMI":
if not self._zha_device.skip_configuration:
await self.bind()
if self.cluster.is_server:
for report_config in self._report_config:
@ -203,8 +202,9 @@ class ZigbeeChannel(LogMixin):
report_config["attr"], report_config["config"]
)
await asyncio.sleep(uniform(0.1, 0.5))
self.debug("finished channel configuration")
self.debug("finished channel configuration")
else:
self.debug("skipping channel configuration")
self._status = ChannelStatus.CONFIGURED
async def async_initialize(self, from_cache):
@ -264,7 +264,7 @@ class ZigbeeChannel(LogMixin):
def log(self, level, msg, *args):
"""Log a message."""
msg = f"[%s:%s]: {msg}"
args = (self.device.nwk, self._id,) + args
args = (self.device.nwk, self._id) + args
_LOGGER.log(level, msg, *args)
def __getattr__(self, name):

View File

@ -146,9 +146,8 @@ class IASZoneChannel(ZigbeeChannel):
async def async_configure(self):
"""Configure IAS device."""
# Xiaomi devices don't need this and it disrupts pairing
if self._zha_device.manufacturer == "LUMI":
self.debug("finished IASZoneChannel configuration")
if self._zha_device.skip_configuration:
self.debug("skipping IASZoneChannel configuration")
return
self.debug("started IASZoneChannel configuration")

View File

@ -213,6 +213,11 @@ class ZHADevice(LogMixin):
if Groups.cluster_id in clusters:
return True
@property
def skip_configuration(self):
"""Return true if the device should not issue configuration related commands."""
return self._zigpy_device.skip_configuration
@property
def gateway(self):
"""Return the gateway for this device."""

View File

@ -5,7 +5,7 @@
"documentation": "https://www.home-assistant.io/integrations/zha",
"requirements": [
"bellows-homeassistant==0.13.2",
"zha-quirks==0.0.32",
"zha-quirks==0.0.33",
"zigpy-cc==0.1.0",
"zigpy-deconz==0.7.0",
"zigpy-homeassistant==0.13.2",

View File

@ -2130,7 +2130,7 @@ zengge==0.2
zeroconf==0.24.4
# homeassistant.components.zha
zha-quirks==0.0.32
zha-quirks==0.0.33
# homeassistant.components.zhong_hong
zhong_hong_hvac==1.0.9

View File

@ -732,7 +732,7 @@ yahooweather==0.10
zeroconf==0.24.4
# homeassistant.components.zha
zha-quirks==0.0.32
zha-quirks==0.0.33
# homeassistant.components.zha
zigpy-cc==0.1.0

View File

@ -72,6 +72,7 @@ class FakeDevice:
self.last_seen = time.time()
self.status = 2
self.initializing = False
self.skip_configuration = False
self.manufacturer = manufacturer
self.model = model
self.node_desc = zigpy.zdo.types.NodeDescriptor()