From 81fbd9c154fc3fa1c939322b05094b5d0919e33c Mon Sep 17 00:00:00 2001 From: Stephan Hadinger Date: Thu, 19 Dec 2024 16:46:59 +0000 Subject: [PATCH] Berry Zigbee fix attributes --- CHANGELOG.md | 1 + .../berry_tasmota/src/embedded/zigbee_zb_coord.be | 2 -- .../src/embedded/zigbee_zcl_attribute.be | 14 +++++++++----- 3 files changed, 10 insertions(+), 7 deletions(-) diff --git a/CHANGELOG.md b/CHANGELOG.md index c4252b5d071c..f4171acb72ac 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -15,6 +15,7 @@ All notable changes to this project will be documented in this file. - TLS disable ECDSA for MQTT to ensure we don't break fingerprints after #22649 ### Fixed +- Berry Zigbee fix wrong attributes ### Removed diff --git a/lib/libesp32/berry_tasmota/src/embedded/zigbee_zb_coord.be b/lib/libesp32/berry_tasmota/src/embedded/zigbee_zb_coord.be index f49ce273cf27..3cb07eb4577c 100644 --- a/lib/libesp32/berry_tasmota/src/embedded/zigbee_zb_coord.be +++ b/lib/libesp32/berry_tasmota/src/embedded/zigbee_zb_coord.be @@ -59,8 +59,6 @@ class zb_coord : zb_coord_ntv if zcl_attribute_list_ptr != nullptr attr_list = self.zcl_attribute_list(zcl_attribute_list_ptr) end - - #print(format(">ZIG: cmd=%s data_type=%s data=%s idx=%i", event_type, data_type, str(data), idx)) var i = 0 while i < size(self._handlers) diff --git a/lib/libesp32/berry_tasmota/src/embedded/zigbee_zcl_attribute.be b/lib/libesp32/berry_tasmota/src/embedded/zigbee_zcl_attribute.be index f960f8e74796..993575733b5d 100644 --- a/lib/libesp32/berry_tasmota/src/embedded/zigbee_zcl_attribute.be +++ b/lib/libesp32/berry_tasmota/src/embedded/zigbee_zcl_attribute.be @@ -205,11 +205,13 @@ class zcl_attribute_list : zcl_attribute_list_ntv var v # shortaddr - if (v := self.shortaddr) != nil + v = self.shortaddr + if v != nil items.push(f'"Device":"0x{v:04X}"') end # groupaddr - if (v := self.groupaddr) != nil + v = self.groupaddr + if v != nil items.push(f'"Group":"0x{v:04X}"') end @@ -223,13 +225,15 @@ class zcl_attribute_list : zcl_attribute_list_ntv end # Endpoint - if (v := self.src_ep) != nil + v = self.src_ep + if v != nil items.push(f'"Endpoint":{v}') end # LQI - if (v := self.lqi) != nil - items.push(f'"LinkQuality":{v}') + v := self.lqi + if v != nil + items.push(f'"LinkQuality":{v:i}') end var s = "{" + items.concat(",") + "}"