Skip to content

Commit

Permalink
Give DDF content precedence over legacy sensor load (#7957)
Browse files Browse the repository at this point in the history
  • Loading branch information
SwoopX authored Oct 9, 2024
1 parent 1122387 commit f34b74b
Showing 1 changed file with 3 additions and 7 deletions.
10 changes: 3 additions & 7 deletions database.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -3505,17 +3505,13 @@ static int sqliteLoadAllSensorsCallback(void *user, int ncols, char **colval , c
return 0;
}

const int itemCount = DB_GetSubDeviceItemCount(sensor.item(RAttrUniqueId)->toLatin1String());

if (itemCount == 0)
{
DBG_Printf(DBG_INFO, "DB legacy loading sensor %s %s, later handled by DDF %s\n", qPrintable(sensor.name()), qPrintable(sensor.id()), qPrintable(ddf.product));
}
else if (DEV_TestManaged() || DDF_IsStatusEnabled(ddf.status))
if (DEV_TestManaged() || DDF_IsStatusEnabled(ddf.status))
{
DBG_Printf(DBG_INFO, "DB skip loading sensor %s %s, handled by DDF %s\n", qPrintable(sensor.name()), qPrintable(sensor.id()), qPrintable(ddf.product));
return 0;
}

DBG_Printf(DBG_INFO, "DB legacy loading sensor %s %s, should be added into DDF %s\n", qPrintable(sensor.name()), qPrintable(sensor.id()), qPrintable(ddf.product));
}
}

Expand Down

0 comments on commit f34b74b

Please sign in to comment.