Skip to content

Commit

Permalink
[ESPEasy p2p] Fix not checking for sensor type from old nodes
Browse files Browse the repository at this point in the history
  • Loading branch information
TD-er committed Dec 22, 2023
1 parent 1c26e7e commit a7f089b
Showing 1 changed file with 4 additions and 4 deletions.
8 changes: 4 additions & 4 deletions src/_C013.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -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);
Expand All @@ -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) {
Expand Down

0 comments on commit a7f089b

Please sign in to comment.