mirror of
https://github.com/arendst/Tasmota.git
synced 2025-07-24 19:26:37 +00:00
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 + 128 = 180º flip to side x on top
|
||||||
// presentValue = x + 256 = push/slide cube while side x is 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
|
// 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();
|
int32_t val = attr.getInt();
|
||||||
const __FlashStringHelper *aqara_click = F("click");
|
const __FlashStringHelper *aqara_click = F("click");
|
||||||
const __FlashStringHelper *aqara_action = F("action");
|
const __FlashStringHelper *aqara_action = F("action");
|
||||||
@ -1503,25 +1503,6 @@ void ZCLFrame::syntheticAqaraCubeOrButton(class Z_attribute_list &attr_list, cla
|
|||||||
case 0:
|
case 0:
|
||||||
attr_list.addAttribute(aqara_action).setStr(PSTR("hold"));
|
attr_list.addAttribute(aqara_action).setStr(PSTR("hold"));
|
||||||
break;
|
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:
|
case 1:
|
||||||
attr_list.addAttribute(aqara_click).setStr(PSTR("single"));
|
attr_list.addAttribute(aqara_click).setStr(PSTR("single"));
|
||||||
break;
|
break;
|
||||||
@ -1537,6 +1518,9 @@ void ZCLFrame::syntheticAqaraCubeOrButton(class Z_attribute_list &attr_list, cla
|
|||||||
case 18:
|
case 18:
|
||||||
attr_list.addAttribute(aqara_action).setStr(PSTR("shake"));
|
attr_list.addAttribute(aqara_action).setStr(PSTR("shake"));
|
||||||
break;
|
break;
|
||||||
|
case 255:
|
||||||
|
attr_list.addAttribute(aqara_action).setStr(PSTR("release"));
|
||||||
|
break;
|
||||||
default:
|
default:
|
||||||
attr_list.addAttribute(aqara_click).setUInt(val);
|
attr_list.addAttribute(aqara_click).setUInt(val);
|
||||||
break;
|
break;
|
||||||
|
Loading…
x
Reference in New Issue
Block a user