mirror of https://github.com/arendst/Tasmota.git
Zigbee fix TRADFRI battery percentage
This commit is contained in:
parent
7d03bcf707
commit
de9f559b50
|
@ -1238,6 +1238,15 @@ void ZCLFrame::computeSyntheticAttributes(Z_attribute_list& attr_list) {
|
|||
attr_list.addAttribute(0x0001, 0x0021).setUInt(toPercentageCR2032(mv) * 2);
|
||||
}
|
||||
break;
|
||||
case 0x00010021: // BatteryPercentage
|
||||
{
|
||||
const char * model_c = zigbee_devices.getModelId(_srcaddr); // null if unknown
|
||||
String modelId((char*) model_c);
|
||||
if (modelId.startsWith(F("TRADFRI"))) {
|
||||
attr.setUInt(attr.getUInt() * 2); // bug in TRADFRI battery, need to double the value
|
||||
}
|
||||
}
|
||||
break;
|
||||
case 0x02010008: // Pi Heating Demand - solve Eutotronic bug
|
||||
{
|
||||
const char * manufacturer_c = zigbee_devices.getManufacturerId(_srcaddr); // null if unknown
|
||||
|
|
Loading…
Reference in New Issue