From a7f089b1a2af2af03c6ebf6efac69095df0bb52d Mon Sep 17 00:00:00 2001 From: TD-er Date: Fri, 22 Dec 2023 23:11:49 +0100 Subject: [PATCH] [ESPEasy p2p] Fix not checking for sensor type from old nodes --- src/_C013.cpp | 8 ++++---- 1 file changed, 4 insertions(+), 4 deletions(-) diff --git a/src/_C013.cpp b/src/_C013.cpp index 48e1b789b2..73add1ac36 100644 --- a/src/_C013.cpp +++ b/src/_C013.cpp @@ -312,13 +312,13 @@ void C013_Receive(struct EventStruct *event) { // // If the node is not present in the nodes list (e.g. it had not announced itself in the last 10 minutes or announcement was missed) // Then we cannot be sure about its build. - bool mustMatchPluginID = false; + bool mustMatch = false; NodeStruct *sourceNode = Nodes.getNode(dataReply.sourceUnit); if (sourceNode != nullptr) { - mustMatchPluginID = sourceNode->build >= 20460; + mustMatch = sourceNode->build >= 20460; } - if (mustMatchPluginID && !dataReply.matchesPluginID(Settings.getPluginID_for_task(dataReply.destTaskIndex))) { + if (mustMatch && !dataReply.matchesPluginID(Settings.getPluginID_for_task(dataReply.destTaskIndex))) { // Mismatch in plugin ID from sending node if (loglevelActiveFor(LOG_LEVEL_ERROR)) { String log = concat(F("P2P data : PluginID mismatch for task "), dataReply.destTaskIndex + 1); @@ -333,7 +333,7 @@ void C013_Receive(struct EventStruct *event) { const Sensor_VType sensorType = TempEvent.getSensorType(); - if (dataReply.matchesSensorType(sensorType)) { + if (!mustMatch || dataReply.matchesSensorType(sensorType)) { TaskValues_Data_t *taskValues = UserVar.getTaskValues_Data(dataReply.destTaskIndex); if (taskValues != nullptr) {