From 261e12e881310bcf59ebaec792762198e5ee761b Mon Sep 17 00:00:00 2001 From: "David F. Mulcahey" Date: Thu, 7 Apr 2022 20:53:12 -0400 Subject: [PATCH] Fix Samjin Multi acceleration in ZHA (#69636) --- homeassistant/components/zha/core/channels/base.py | 13 +++++++++++-- 1 file changed, 11 insertions(+), 2 deletions(-) diff --git a/homeassistant/components/zha/core/channels/base.py b/homeassistant/components/zha/core/channels/base.py index 50546b7720c..b10209f45f4 100644 --- a/homeassistant/components/zha/core/channels/base.py +++ b/homeassistant/components/zha/core/channels/base.py @@ -8,7 +8,12 @@ import logging from typing import Any import zigpy.exceptions -from zigpy.zcl.foundation import CommandSchema, ConfigureReportingResponseRecord, Status +from zigpy.zcl.foundation import ( + CommandSchema, + ConfigureReportingResponseRecord, + Status, + ZCLAttributeDef, +) from homeassistant.const import ATTR_COMMAND from homeassistant.core import callback @@ -112,7 +117,11 @@ class ZigbeeChannel(LogMixin): if not hasattr(self, "_value_attribute") and self.REPORT_CONFIG: attr = self.REPORT_CONFIG[0].get("attr") if isinstance(attr, str): - self.value_attribute = self.cluster.attributes_by_name.get(attr) + attribute: ZCLAttributeDef = self.cluster.attributes_by_name.get(attr) + if attribute is not None: + self.value_attribute = attribute.id + else: + self.value_attribute = None else: self.value_attribute = attr self._status = ChannelStatus.CREATED