added support for Aqara button WXKG12LM

This commit is contained in:
nicandris 2020-09-12 12:59:51 +02:00
parent 6d24d87ff7
commit 414cf1f9ac
1 changed files with 26 additions and 1 deletions

View File

@ -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
} else if (modelId.startsWith(F("lumi.remote"))) { // only for Aqara button WXKG11LM
int32_t val = attr.getInt();
const __FlashStringHelper *aqara_click = F("click");
const __FlashStringHelper *aqara_action = F("action");
@ -1516,6 +1516,31 @@ void ZCLFrame::syntheticAqaraCubeOrButton(class Z_attribute_list &attr_list, cla
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;
case 2:
attr_list.addAttribute(aqara_click).setStr(PSTR("double"));
break;
case 16:
attr_list.addAttribute(aqara_action).setStr(PSTR("hold"));
break;
case 17:
attr_list.addAttribute(aqara_action).setStr(PSTR("release"));
break;
case 18:
attr_list.addAttribute(aqara_action).setStr(PSTR("shake"));
break;
default:
attr_list.addAttribute(aqara_click).setUInt(val);
break;
}
}
}