mirror of https://github.com/arendst/Tasmota.git
Merge pull request #7807 from s-hadinger/zigbee_fix_endpoint
Zigbee fix skipped attributes
This commit is contained in:
commit
9c8dd2139d
|
@ -659,7 +659,12 @@ bool Z_Devices::jsonIsConflict(uint16_t shortaddr, const JsonObject &values) {
|
||||||
for (auto kv : values) {
|
for (auto kv : values) {
|
||||||
String key_string = kv.key;
|
String key_string = kv.key;
|
||||||
|
|
||||||
if (strcasecmp_P(kv.key, PSTR(D_CMND_ZIGBEE_LINKQUALITY))) { // exception = ignore duplicates for LinkQuality
|
if (0 == strcasecmp_P(kv.key, PSTR(D_CMND_ZIGBEE_ENDPOINT))) {
|
||||||
|
// attribute "Endpoint"
|
||||||
|
if (kv.value.as<unsigned int>() != device.json->get<unsigned int>(kv.key)) {
|
||||||
|
return true;
|
||||||
|
}
|
||||||
|
} else if (strcasecmp_P(kv.key, PSTR(D_CMND_ZIGBEE_LINKQUALITY))) { // exception = ignore duplicates for LinkQuality
|
||||||
if (device.json->containsKey(kv.key)) {
|
if (device.json->containsKey(kv.key)) {
|
||||||
return true; // conflict!
|
return true; // conflict!
|
||||||
}
|
}
|
||||||
|
|
|
@ -504,10 +504,9 @@ int32_t Z_ReceiveAfIncomingMessage(int32_t res, const class SBuffer &buf) {
|
||||||
if (zigbee_devices.jsonIsConflict(srcaddr, json)) {
|
if (zigbee_devices.jsonIsConflict(srcaddr, json)) {
|
||||||
// there is conflicting values, force a publish of the previous message now and don't coalesce
|
// there is conflicting values, force a publish of the previous message now and don't coalesce
|
||||||
zigbee_devices.jsonPublishFlush(srcaddr);
|
zigbee_devices.jsonPublishFlush(srcaddr);
|
||||||
} else {
|
|
||||||
zigbee_devices.jsonAppend(srcaddr, json);
|
|
||||||
zigbee_devices.setTimer(srcaddr, USE_ZIGBEE_COALESCE_ATTR_TIMER, clusterid, srcendpoint, 0, &Z_PublishAttributes);
|
|
||||||
}
|
}
|
||||||
|
zigbee_devices.jsonAppend(srcaddr, json);
|
||||||
|
zigbee_devices.setTimer(srcaddr, USE_ZIGBEE_COALESCE_ATTR_TIMER, clusterid, srcendpoint, 0, &Z_PublishAttributes);
|
||||||
} else {
|
} else {
|
||||||
// Publish immediately
|
// Publish immediately
|
||||||
zigbee_devices.jsonPublishNow(srcaddr, json);
|
zigbee_devices.jsonPublishNow(srcaddr, json);
|
||||||
|
|
Loading…
Reference in New Issue