mirror of
https://github.com/arendst/Tasmota.git
synced 2025-04-26 07:47:15 +00:00
Merge pull request #16597 from s-hadinger/zigbee_fix_cmd
Fix bug in Z_attribute::equalsCmd
This commit is contained in:
commit
a181ca7ddf
@ -561,7 +561,7 @@ bool Z_attribute::equalsKey(const Z_attribute & attr2, bool ignore_key_suffix) c
|
|||||||
|
|
||||||
bool Z_attribute::equalsId(uint16_t _cluster, uint16_t _attr_id, uint8_t suffix) const {
|
bool Z_attribute::equalsId(uint16_t _cluster, uint16_t _attr_id, uint8_t suffix) const {
|
||||||
if (key_is_cmd || key_is_str) { return false; }
|
if (key_is_cmd || key_is_str) { return false; }
|
||||||
if ((this->cluster == _cluster) && (this->attr_id == _attr_id) && (!this->key_is_cmd)) {
|
if ((this->cluster == _cluster) && (this->attr_id == _attr_id)) {
|
||||||
if (suffix) {
|
if (suffix) {
|
||||||
if (key_suffix == suffix) { return true; }
|
if (key_suffix == suffix) { return true; }
|
||||||
} else {
|
} else {
|
||||||
@ -574,7 +574,7 @@ bool Z_attribute::equalsId(uint16_t _cluster, uint16_t _attr_id, uint8_t suffix)
|
|||||||
bool Z_attribute::equalsCmd(uint16_t _cluster, uint8_t _cmd_id, bool _direction, bool cmd_general, uint8_t suffix) const {
|
bool Z_attribute::equalsCmd(uint16_t _cluster, uint8_t _cmd_id, bool _direction, bool cmd_general, uint8_t suffix) const {
|
||||||
if (!key_is_cmd || key_is_str) { return false; }
|
if (!key_is_cmd || key_is_str) { return false; }
|
||||||
uint16_t _attr_id = _cmd_id | (_direction ? 0x100 : 0x000) | (cmd_general ? 0x200 : 0x000);
|
uint16_t _attr_id = _cmd_id | (_direction ? 0x100 : 0x000) | (cmd_general ? 0x200 : 0x000);
|
||||||
if ((this->cluster == _cluster) && (this->attr_id == _attr_id) && (!this->key_is_cmd)) {
|
if ((this->cluster == _cluster) && (this->attr_id == _attr_id)) {
|
||||||
if (suffix) {
|
if (suffix) {
|
||||||
if (key_suffix == suffix) { return true; }
|
if (key_suffix == suffix) { return true; }
|
||||||
} else {
|
} else {
|
||||||
|
Loading…
x
Reference in New Issue
Block a user