Merge pull request #10494 from s-hadinger/zigbee_opple2

Zigbee Opple Aqara remover Action to Click
This commit is contained in:
s-hadinger 2021-01-10 15:40:32 +01:00 committed by GitHub
commit 250b1c4ae2
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
1 changed files with 11 additions and 12 deletions

View File

@ -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;
}
}