From a479f46f713298a15955c4ed8a450c3f2d243f7c Mon Sep 17 00:00:00 2001 From: Stephan Hadinger Date: Sun, 10 Jan 2021 15:27:21 +0100 Subject: [PATCH] Zigbee Opple Aqara remover Action to Click --- tasmota/xdrv_23_zigbee_5_converters.ino | 23 +++++++++++------------ 1 file changed, 11 insertions(+), 12 deletions(-) diff --git a/tasmota/xdrv_23_zigbee_5_converters.ino b/tasmota/xdrv_23_zigbee_5_converters.ino index ad740c0e5..5cfb19d06 100644 --- a/tasmota/xdrv_23_zigbee_5_converters.ino +++ b/tasmota/xdrv_23_zigbee_5_converters.ino @@ -1826,47 +1826,46 @@ void ZCLFrame::syntheticAqaraCubeOrButton(class Z_attribute_list &attr_list, cla int32_t val = attr.getInt(); const __FlashStringHelper *aqara_click = F("click"); // deprecated const __FlashStringHelper *aqara_action = F("action"); // deprecated - static const char * aqara_Click = PSTR("Click"); - static const char * aqara_Action = PSTR("Action"); + Z_attribute & attr_click = attr_list.addAttribute(PSTR("Click"), true); switch (val) { case 0: attr_list.addAttribute(aqara_action).setStr(PSTR("hold")); // deprecated - attr_list.addAttribute(aqara_Action, true).setStr(PSTR("hold")); + attr_click.setStr(PSTR("hold")); break; case 1: attr_list.addAttribute(aqara_click).setStr(PSTR("single")); // deprecated - attr_list.addAttribute(aqara_Click, true).setStr(PSTR("single")); + attr_click.setStr(PSTR("single")); break; case 2: attr_list.addAttribute(aqara_click).setStr(PSTR("double")); // deprecated - attr_list.addAttribute(aqara_Click, true).setStr(PSTR("double")); + attr_click.setStr(PSTR("double")); break; case 3: - attr_list.addAttribute(aqara_Click, true).setStr(PSTR("triple")); + attr_click.setStr(PSTR("triple")); break; case 4: - attr_list.addAttribute(aqara_Click, true).setStr(PSTR("quadruple")); + attr_click.setStr(PSTR("quadruple")); break; case 16: attr_list.addAttribute(aqara_action).setStr(PSTR("hold")); // deprecated - attr_list.addAttribute(aqara_Action, true).setStr(PSTR("hold")); + attr_click.setStr(PSTR("hold")); break; case 17: attr_list.addAttribute(aqara_action).setStr(PSTR("release")); // deprecated - attr_list.addAttribute(aqara_Action, true).setStr(PSTR("release")); + attr_click.setStr(PSTR("release")); break; case 18: attr_list.addAttribute(aqara_action).setStr(PSTR("shake")); // deprecated - attr_list.addAttribute(aqara_Action, true).setStr(PSTR("shake")); + attr_click.setStr(PSTR("shake")); break; case 255: attr_list.addAttribute(aqara_action).setStr(PSTR("release")); // deprecated - attr_list.addAttribute(aqara_Action, true).setStr(PSTR("release")); + attr_click.setStr(PSTR("release")); break; default: attr_list.addAttribute(aqara_click).setUInt(val); - attr_list.addAttribute(aqara_Click, true).setStr(PSTR("release")); + attr_click.setStr(PSTR("release")); break; } }