Modify full volume detection on Smartsource

The Smartsource firmware seems to have changed rendering the old
test invalid.
This commit is contained in:
D. Berge
2025-08-15 14:46:44 +02:00
parent e849c47f01
commit 75284322f1

View File

@@ -53,13 +53,13 @@ class DetectSoftStart {
meta: {auto: true, author: `*${this.constructor.name}*`}
};
DEBUG("Posting event", projectId, payload);
} else if (cur.num_active == cur.num_guns && prev.num_active < cur.num_active) {
if (ctx.dryRun) {
DEBUG(`DRY RUN: await ctx.db.event.post(${projectId}, ${payload});`);
} else {
await ctx.db.event.post(projectId, payload);
}
} else if ((cur.num_active == cur.num_guns || (prev.num_nofire > 0 && cur.num_nofire == 0)) && prev.num_active < cur.num_active) {
INFO("Full volume detected @", cur.tstamp);
const projectId = await ctx.schema2pid(cur._schema ?? prev._schema);