mirror of https://github.com/arendst/Tasmota.git
merged together the 2 aqara buttons
This commit is contained in:
parent
414cf1f9ac
commit
a951a38d39
|
@ -1494,7 +1494,7 @@ void ZCLFrame::syntheticAqaraCubeOrButton(class Z_attribute_list &attr_list, cla
|
|||
// presentValue = x + 128 = 180º flip to side x on top
|
||||
// presentValue = x + 256 = push/slide cube while side x is on top
|
||||
// presentValue = x + 512 = double tap while side x is on top
|
||||
} else if (modelId.startsWith(F("lumi.remote"))) { // only for Aqara button WXKG11LM
|
||||
} else if (modelId.startsWith(F("lumi.remote")) || modelId.startsWith(F("lumi.sensor_switch"))) { // only for Aqara buttons WXKG11LM & WXKG12LM
|
||||
int32_t val = attr.getInt();
|
||||
const __FlashStringHelper *aqara_click = F("click");
|
||||
const __FlashStringHelper *aqara_action = F("action");
|
||||
|
@ -1503,25 +1503,6 @@ void ZCLFrame::syntheticAqaraCubeOrButton(class Z_attribute_list &attr_list, cla
|
|||
case 0:
|
||||
attr_list.addAttribute(aqara_action).setStr(PSTR("hold"));
|
||||
break;
|
||||
case 1:
|
||||
attr_list.addAttribute(aqara_click).setStr(PSTR("single"));
|
||||
break;
|
||||
case 2:
|
||||
attr_list.addAttribute(aqara_click).setStr(PSTR("double"));
|
||||
break;
|
||||
case 255:
|
||||
attr_list.addAttribute(aqara_click).setStr(PSTR("release"));
|
||||
break;
|
||||
default:
|
||||
attr_list.addAttribute(aqara_click).setUInt(val);
|
||||
break;
|
||||
}
|
||||
} else if (modelId.startsWith(F("lumi.sensor_switch"))) { // only for Aqara button WXKG12LM
|
||||
int32_t val = attr.getInt();
|
||||
const __FlashStringHelper *aqara_click = F("click");
|
||||
const __FlashStringHelper *aqara_action = F("action");
|
||||
|
||||
switch (val) {
|
||||
case 1:
|
||||
attr_list.addAttribute(aqara_click).setStr(PSTR("single"));
|
||||
break;
|
||||
|
@ -1537,6 +1518,9 @@ void ZCLFrame::syntheticAqaraCubeOrButton(class Z_attribute_list &attr_list, cla
|
|||
case 18:
|
||||
attr_list.addAttribute(aqara_action).setStr(PSTR("shake"));
|
||||
break;
|
||||
case 255:
|
||||
attr_list.addAttribute(aqara_action).setStr(PSTR("release"));
|
||||
break;
|
||||
default:
|
||||
attr_list.addAttribute(aqara_click).setUInt(val);
|
||||
break;
|
||||
|
|
Loading…
Reference in New Issue