Merge pull request #7807 from s-hadinger/zigbee_fix_endpoint

Zigbee fix skipped attributes
This commit is contained in:
Theo Arends 2020-02-28 09:32:31 +01:00 committed by GitHub
commit 9c8dd2139d
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
2 changed files with 8 additions and 4 deletions

View File

@ -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!
} }

View File

@ -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);